【问题标题】:redirect one domain to another with htaccess rules使用 htaccess 规则将一个域重定向到另一个域
【发布时间】:2011-06-29 05:58:18
【问题描述】:

我想知道如何将我的用户从旧域重定向到新网址

例如

http://www.5.joblessbuddy.com/news.html

进入这个

http://www.1.joblessbuddy.hu/news.html

我在我的 htaccess 上做了这个,但没有工作

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} http://www.5.joblessbuddy.com/$ [NC]
RewriteRule ^(.*)$ http://www.1.joblessbuddy.hu$1 [R=301,L]

任何建议将不胜感激

提前致谢

【问题讨论】:

    标签: .htaccess redirect


    【解决方案1】:

    试试这个:

    RewriteCond %{HTTP_HOST} (www\.)?5\.joblessbuddy\.com [NC]
    RewriteRule ^(.*)$ http://www.1.joblessbuddy.hu/$1 [R=301,L]
    

    顺便说一句:mod_rewrite 备忘单 v2 是你的 friend。

    【讨论】:

      猜你喜欢
      • 2020-05-04
      • 1970-01-01
      • 1970-01-01
      • 2010-10-14
      • 2017-05-18
      • 1970-01-01
      • 1970-01-01
      • 2020-05-26
      • 1970-01-01
      相关资源
      最近更新 更多