将文件夹URL重定向到onepager

时间:2017-03-02 01:26:26

标签: wordpress .htaccess redirect mod-rewrite

我尝试将文件夹 web 中的所有文件重定向到新的onepager网站。使用谷歌链接删除了wordpress安装。

文件夹网页中的网址看起来像

http://example.com/web/a/b/c
http://example.com/web/ab/cd

我需要的是重定向到像

这样的新域名
http://new-domain.com/

这是我的代码

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^*$ [NC]
RewriteRule ^(.*)$ http://new-domain.com [R=301,L]

1 个答案:

答案 0 :(得分:0)

尝试如下,

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/web [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]