我正在开发一款PHP应用程序,在其中需要在get请求中使用正斜杠代替问号,例如:
www.example.com/article?aid=10&aname=my-article 应该被更改为
www.example.com/article/10/my-article 以下是我的.htaccess文件:
www.example.com/article?aid=10&aname=my-article 应该被更改为
www.example.com/article/10/my-article 以下是我的.htaccess文件:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ http://example.com/$1 [R=301,L]
# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ http://example.com/$1 [R=301,L]
# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^articles/(.*)$ articles?q=$1 [L,QSA,B]
我尝试了很多次,但是还没有找到解决方案。这个问题怎么办呢?
aid
、aname
等。我已经更新了我的帖子。 - Lorenzo Belfanti