301重定向在.htaccess导致500服务器错误(重定向到非URL)

301重定向在.htaccess导致500服务器错误(重定向到非URL)

问题描述:

有这样那样的错误。

在加入重定向301 规则的.htaccess 文件,如:

Redirect 301 "/page1.html" "/dir1/"

我的网站失败,500服务器错误,并在Apache的错误日志中出现此错误:

My site fails with 500 server error and in apache error log this error appears:

[Wed Mar 16 11:08:52 2011] [alert] [client 127.0.0.1] /home/htdocs/site.com/www/.htaccess: Redirect to non-URL

国防部重写安装,也试图提供的网址不带引号。

在生产服务器上的.htaccess这个工作正常,但在当地引起麻烦

任何想法,请)

本规则适用

Redirect 301 "/page1.html" "http://www.site.com/dir1/"

但我需要一种方法来提供相对路径,而不是完整的URL(生产服务器工作这种方式)

but I need a way to supply relative paths instead of full urls (production server works that way)

改变了所有重定向301 规则:

RewriteRule ^/page1.html$ /dir1/page.html [R=301,L]

现在的工作。但它是如何生产的?

now working. But how does it work on production?