【发布时间】:2017-10-06 20:20:51
【问题描述】:
我想永久重定向这些网址只:
http://www.example.com/privacy.php
http://www.example.com/terms.php
http://www.example.com/contacts.php
到:
http://www.example.com/privacy
http://www.example.com/terms
http://www.example.com/contacts
继续提供相应.php 文件中的内容。
任何帮助将不胜感激!
谢谢。
附:我编辑了我的问题,因为它已被确定为另一个问题的可能重复;建议问题的答案并不能解决我的问题
这是 .htaccess 当前内容:
RewriteEngine On
RewriteBase /
# Adds the www. before any URL
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Redirects index.php page to the homepage
RewriteRule ^index\.php/?$ / [R=301,L]
# Redirects all old pages example.com/?d=124575 to http://www.example.com
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /\?(.*)\ HTTP
RewriteRule ^ /? [R=301,L]
【问题讨论】:
-
感谢您抽出宝贵时间,但建议问题中的答案并不能解决我的要求
标签: .htaccess url mod-rewrite