原 URL :
api/userdata/profile?user_id=1&var2=value2
希望重写到:
apirouter.php?module=userdata&action=profile&user_id=1&var2=value2
所以在.htaccess里面:
RewriteRule ^.*?api/(.*?)/(.*?)\?(.*)$ apirouter.php?module=$1&action=$2&$3 [L]
然而并不能识别,求正确姿势?
1
yakczh 2015-07-18 00:41:43 +08:00
RewriteEngine on
RewriteRule api/(userdata)/(profile) apirouter.php?module=$1&action=$2 [QSA,L] |