简体   繁体   English

简单的mod_rewrite规则不起作用[L]

[英]Simple mod_rewrite rule not working [L]

So this is my first time doing mod_rewrite and I'm using tutorials and generators and it's been going okay so far except for the last line below which if I haven't made any mistake should redirect about.php to about/ Anybody know why it doesn't ? 所以这是我第一次做mod_rewrite,我正在使用教程和生成器,到目前为止一切正常,除了最后一行,如果我没有做任何错误,应该将about.php重定向到about /任何人都知道为什么不是吗?

All the other rules are working without issues (I did double check the page existed, I tried to add a slash before about.php as my website is on a server with multiple websites...) 所有其他规则均正常运行(我仔细检查了页面是否存在,我尝试在about.php之前添加斜杠,因为我的网站位于具有多个网站的服务器上...)

Options +FollowSymLinks

#Sub-dir e.g: /cmsms

RewriteBase /

#redirect www.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.metareviewr.com
RewriteRule (.*) http://metareviewr.com/$1 [R=301,L]

#RewriteRule ^show/([^/]*)/$ /tvshow.php?id=$1 [L]
RewriteRule ^show/([^/]*)/([^/]*)/$ /tvshow.php?id=$1&?name=$2 [L]

# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteRule ^(([^/]+/)*)index\.php$ http://metareviewr.com/$1 [R=301,L]

RewriteRule ^about/$ about.php [L]

这应该工作

RewriteRule ^about.php$ about/ [L,R=301]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM