当前URL:
http://localhost/blog/profile.php?username=Username&page_type=following我希望它是:
http://localhost/blog/profile/Username/following当前.htaccess:
RewriteEngine On
CheckCaseOnly On
CheckSpelling On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^profile/(.*)$ /blog/profile.php?username=$1&page_type=$2 [QSA,L]可以这样重写吗?还是有更好的方法?
发布于 2013-04-09 04:58:47
您需要两个捕获组:
RewriteRule ^profile/(.*?)/(.*)$ /blog/profile.php?username=$1&page_type=$2 [QSA,L]发布于 2013-04-09 04:59:00
您在RewriteRule模式中没有page_type的$2
RewriteRule ^profile/(.*?)/(.*)$ /blog/profile.php?username=$1&page_type=$2 [QSA,L]https://stackoverflow.com/questions/15888797
复制相似问题