标签云

微信群

扫码加入我们

WeChat QR Code

I wanna to get rid of GET string parameters, from keys.For example this is initial uri:http://example.com/api/get_users_method?user_age_from=18&user_age_to=25&user_city=ohiohttp://example.com/api/get_users_method?user_age_from=18&user_age_to=25 http://example.com/api/get_users_method?user_city=ohioI wanna make like this:http://example.com/api/get_users_method/18/25/ohio http://example.com/api/get_users_method/18/25 http://example.com/api/get_users_method/ohioHow can i get this result? I found some solution, to edit htaccess file, but it doesn't work unfortunately, maybe i made some mistakes in htacces file? I'm using php. Thanks!RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^ index.php [QSA,L]RewriteRule ^([a-z0-9]+)/([a-z0-9]+)/?$ /api/get_users_method?user_age_from=$1&user_age_to=$2&user_city=$3 [NC,L]


Hi Denis if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

2019年04月18日33分29秒