301重定向单个页面.htaccess

时间:2015-02-14 13:39:20

标签: apache .htaccess redirect

我已尝试过各种方法来编写.htaccess文件,但我得到的只是500服务器错误。

我正在尝试将所有网页从一个网站重定向到另一个网站。这是因为该网站已被重写并更改了名称。我希望保持所有的seo完整。

我已将.htaccess文件放在根目录中,这是一个副本

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^yachting-school.co.uk [NC]
RewriteRule ^(.*)$ http://www.yachting-school.co.uk/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ http://www.dreamortwosailing.co.uk/$1 [R=301,L]
#

Redirect 301 /index.htm http://www.dreamortwosailing.co.uk/index.php
Redirect 301 /essential_stuff/about_us.php http://www.dreamortwosailing.co.uk/info/us/

1 个答案:

答案 0 :(得分:0)

我认为你的语法略有规则
重定向301 ^ / index.htm $ http://www.dreamortwosailing.co.uk/index.php
重定向301 ^ / essential_stuff / about_us.php $ http://www.dreamortwosailing.co.uk/info/us/

相关问题