【问题标题】:Redirect website to addon domain - htaccess将网站重定向到插件域 - htaccess
【发布时间】:2016-10-26 15:35:40
【问题描述】:

我有一个主机,它有一个主域以及同一主机下的另外 5 个(附加)域。 所有网站都在上面运行 Wordpress。 我想将主域重定向到其中一个插件域,并且部分重定向有问题,所有页面都重定向到正确的位置,但某些资源似乎进入了无限重定向循环(wp-include css for例子)。 我尝试过的重定向:

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^crossword\-clue\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^crossword\-clues\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.wisely\-chosen\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^wisely\-chosen\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.info\-beast\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^info\-beast\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.crossword\-clues\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.quickinfo\.co\.il$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.israwords\.co\.il$ [NC,OR]
RewriteCond %{HTTP_HOST} !^israwords\.co\.il$ [NC,OR]
RewriteCond %{HTTP_HOST} ^israwords\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.israwords\.com$ [NC]
RewriteRule ^(.*)$ http://www.israwords.co.il/$1 [R=301,L]

【问题讨论】:

    标签: html wordpress .htaccess redirect url-redirection


    【解决方案1】:

    重定向

    • www.israwords.com

    • www.israwords.co.il

    你可以用这个:

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^(www\.)?israwords\.com$
    RewriteRule ^ http://www.israwords.co.il%{REQUEST_URI} [L,R=301,NE]
    

    【讨论】:

    • 非常感谢,拯救了这一天!
    • @Raz 打错字抱歉,您可以通过编辑来解决。
    • 我知道,但我不能编辑它,因为它少于 6 个字符
    猜你喜欢
    • 1970-01-01
    • 2012-05-01
    • 2015-09-12
    • 1970-01-01
    • 2021-04-16
    • 1970-01-01
    • 2011-11-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多