什么mod_rewrite规则将301重定向/example.html到/example?
我想将网址翻译或 301 重定向,例如:
www.domain.com/example.html 到 www.domain.com/example
以下是当前的重写规则:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteCond %{SERVER_PORT} 80
I would like to translate or 301-redirect urls such as:
www.domain.com/example.html to www.domain.com/example
Here are the current rewrite rules:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteCond %{SERVER_PORT} 80
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请尝试以下操作:
Please try the following:
尝试
RewriteRule (.+)\.html$ $1 [R=301]
Try
RewriteRule (.+)\.html$ $1 [R=301]