将www.example.com重定向到old.example.com-htaccess-magento 2

时间:2018-09-04 06:38:28

标签: apache .htaccess url-rewriting subdomain magento2

我想将所有带有http://www.example.com/ ...的链接重定向到http://old.example.com

我原来的magento商店需要保留,但我想在其他地方使用该域,因此我想将old.example.com分配为子域来访问它。但是,网站上的所有链接仍然具有www.example.com。我需要将www.example.com全局替换为old.example.com

到目前为止,我有以下内容,但它并不是用www全局替换所有链接。老了。

Options +FollowSymLinks
RewriteEngine on
    RewriteCond %{HTTP_HOST} !^old.alterlondon.com$ [NC]
    RewriteRule ^(.*)$ http://old.alterlondon.com/$1 [R=301,L]
    ##RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://old.alterlondon.com/$1 [R=301,L]

0 个答案:

没有答案