【发布时间】:2018-01-07 22:01:56
【问题描述】:
我做了一些从旧域到新主机上的新域的重定向 301。但是我检查了旧主页站点的 HTTPS 版本仍在工作并且没有重定向到新域,但是旧主页上的链接正在重定向到新域链接。如何将旧域的 HTTPS 版本重定向到新域的 HTTPS 版本?以下是我的 .htaccess 的一部分
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} /store/catalogsearch/result/index/ [NC]
RewriteRule ^ https://www.newdomain.com/? [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(default|index)\.(html|php|htm)\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)(default|main|index)\.(html|php|htm)$ http://www.newdomain.com/$1 [R=301,NC]
RewriteRule ^store/?$ http://www.newdomain.com [L,NC,R=301]
RewriteRule ^store/folder/?$ http://www.newdomain.com/otherfolder/another-folder/ [L,NC,R=301]
RewriteRule ^store/folder1/folder2/?$ http://www.newdomain.com/folder-3/folder-4 [L,NC,R=301]
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,NE,L]
提前感谢您的帮助。
【问题讨论】:
标签: php apache .htaccess magento redirect