【发布时间】:2014-09-08 13:03:33
【问题描述】:
我最近有一个客户站点更改了页面名称,出于 SEO 的目的,我们需要将旧链接重定向到新链接,但由于某种原因它无法正常工作。
.htaccess 看起来像这样:
AddHandler php5-script .php
RewriteEngine On # Turn on the rewriting engine
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Redirect 301 /oldpage1 /newpage1
Redirect 301 /oldpage2 /newpage2
但是页面被重定向为:
http://examplesite.com:443/newpage1
我什至尝试过这样的 301:
Redirect 301 /oldpage1 https://examplesite.com/newpage1
两种方式产生相同的结果。有什么想法吗?
【问题讨论】:
-
什么被重定向到
http://examplesite.com:443/newpage1? -
如果我点击来自
https://examplesite.com/oldpage1的链接,它应该会转到https://examplesite.com/newpage1,但会转到http://examplesite.com:443/newpage1
标签: php apache .htaccess redirect https