【问题标题】:wamp/localhost htaccess - bad flag delimiterswamp/localhost htaccess - 错误的标志分隔符
【发布时间】:2014-12-21 11:25:16
【问题描述】:

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

我正在运行 WAMP

  • Apache 2.2.22
  • PHP 5.3.13

我已添加到 hosts 文件中:

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 已开启。

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

[2014 年 10 月 26 日星期日 09:24:17] [警报] [客户端 127.0.0.1] C:/wamp/www/testsite/.htaccess: RewriteCond: bad flag delimiters, 推荐人: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 设置可能有什么问题吗?

谢谢。

【问题讨论】:

  • "I am trying to migrate my testing site, locally" - 您是否正在从 Linux Apache 服务器迁移到 WAMP?如果是这种情况,请确保行尾是 DOS/Windows 样式。如果您在记事本中看到它,它应该在视觉上很明显; Notepad++ 等其他编辑器不显示视觉差异,仅在状态栏中显示。
  • 是的,我从文件中删除了一堆空行(只是为了让它看起来更好),这就是问题的原因。

标签: apache .htaccess wamp wampserver


【解决方案1】:

我从文件中删除了大量空白行(仅出于美观目的),当我撤消此文件时,htaccess 文件运行良好。

【讨论】:

    猜你喜欢
    • 2015-02-04
    • 1970-01-01
    • 1970-01-01
    • 2014-06-23
    • 2015-10-24
    • 2017-10-04
    • 2016-07-13
    • 1970-01-01
    • 2015-11-03
    相关资源
    最近更新 更多