如何设置med文件,使其重写www.mydomain.com/index.php?.htaccess =home to www.mydomain.com/home?
我试过这段代码,但它不是我想要的。
RewriteEngine On RewriteBase / # Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php?page= [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule ^([^/]+)/? index.php [L,QSA]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?page=$1 [L]
发布于 2015-05-08 17:41:10
你的第一条重定向规则不正确。您可以使用:
RewriteEngine On
RewriteBase /
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&]+) [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule ^ /%1? [R=302,L,NE]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?page=$1 [L,QSA]https://stackoverflow.com/questions/30120392
复制相似问题