【发布时间】:2013-10-23 11:28:54
【问题描述】:
我想将我的旧域重定向到新域。实际上我的网站在 www_olddomain_pl/index.php 下,英文版在 www_olddomain_com/index_en.php 下
我想做什么?
olddomain_pl -> www_new_pl
www_olddomain_pl -> www_new_pl
odldomain_com -> www_new_com
www_olddomain_com -> www_new_com
并从索引重定向到没有索引。 我到底有什么?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)olddomain_pl(.*) [NC]
RewriteRule ^(.*)$ http://www_olddomain_pl/$1 [R=301,L]
RewriteRule ^index.php$ http://www_new_pl/ [R=301,L]
RewriteCond %{HTTP_HOST} ^(.*)olddomain_com(.*) [NC]
RewriteRule ^(.*)$ http://www_new_com/$1 [R=301,L]
我不知道该怎么办。
编辑: 还有一个: 实际上,我的网站有两个版本 - 波兰语和英语。 波兰语版本在 olddomain_pl/index.php 下 英文版在olddomain_pl/index_en.php下
我想要: new_pl 下的波兰语版本 new_com下英文版
所以我需要从不带 www 重定向到带 www 并从 index.php 或 index_en.php 重定向到不带。
【问题讨论】:
标签: php .htaccess mod-rewrite redirect