wamp / localhost htaccess - 坏标记分隔符

时间:2014-10-25 22:36:40

标签: apache .htaccess wamp wampserver

我正在尝试在本地迁移我的测试网站。

我正在运行 WAMP

  • Apache 2.2.22
  • Php 5.3.13

我已添加到主机文件:

  

127.0.0.1 local.testsite.com

我已经添加到httpd-vhosts.conf(并将其包含在httpd.conf中):

<Directory C:\wamp\www\testsite>
Order Deny,Allow   
Allow from all 
</Directory>

<VirtualHost *:80>   
DocumentRoot "C:\wamp\www\testsite" 
ServerName local.testsite.com 
</VirtualHost>

并且rewrite_module为ON。

我在本地apache错误日志中收到以下错误:

  

[Sun Oct 26 09:24:17 2014] [alert] [client 127.0.0.1]   C:/wamp/www/testsite/.htaccess:RewriteCond:坏标记分隔符,   referer:http://local.testsite.com/

这是我的htaccess文件(在我的外部服务器上运行):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^dashboard/$ / [R=301,L]
RewriteRule ^dashboard$ / [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?%{QUERY_STRING} [NE,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

任何想法可能是我的本地wamp设置的问题?

感谢。

1 个答案:

答案 0 :(得分:1)

我从文件中删除了大量的空白行(仅用于审美目的),当我解开这个时,htaccess文件工作得很好。