【问题标题】:Redirect old site to new address, but one page to new URL将旧网站重定向到新地址,但将一页重定向到新 URL
【发布时间】:2020-04-22 22:46:48
【问题描述】:

我想将我所有的旧域请求重定向到我的新域,但一个子页面除外。旧站点的一个子页面,必须重定向到新站点上的 URL。例如:

siteA.com/* -> siteB.com/#/home/
siteA.com/documents -> siteB.com/#/home/addDocuments

下面是我正在使用的,但它不起作用,因为带有文档的旧页面没有重定向到带有 addDocuments 的新站点,而只是到主页新页面。

Redirect 301 /documents https://siteB.com/#/home/addDocuments 
RewriteCond %{REQUEST_URI} !^/dokumenty [NC]
RewriteRule ^(.*)$ http://siteB.com/ [L,R=301]

我必须在 vhost 配置文件中进行。有什么建议吗?

【问题讨论】:

    标签: apache .htaccess redirect vhosts


    【解决方案1】:

    问题解决了:

    (在服务器站点 A 上)
    重写引擎开启
    重定向 301 /documents https://siteB.com/#/home/addDocuments
    重定向匹配 301 ^/ https://siteB.com

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-25
      • 2016-09-01
      • 2015-08-02
      • 1970-01-01
      • 1970-01-01
      • 2016-06-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多