这是我的测试 .htaccess
RewriteEngine On
Options +FollowSymLinks
#WWW redirect WORKS
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^home/$ index.php [L] #THIS RULE WORKS
RewriteRule ^news/(.+)/$ /news.php?page=$1 [L] #not works
RewriteRule ^news/(.+)/$ /news.php?article=$1 [L] #not works
RewriteRule ^news/$ news.php [L] #WORKS
我想做这个:
"news.php" => "news/"
"news.php?page=3" => "news/3/"
"news.php?article=lorem-ipsum-3" => "news/lorem-ipsum-3/"
使用此 url 规则,这样的 url 效果很好,但不是我想要的:
http://www.xxxxxx.com/news/?page=3 #works
http://www.xxxxxx.com/news/?article=lorem-ipsum-2 #works
如何修复.htaccess?
谢谢