.htaccess:RewriteRule:坏标记分隔符(Wordpress)多站点安装

时间:2016-01-08 06:45:55

标签: php wordpress apache .htaccess mod-rewrite

我遇到了多站点WordPress安装问题,500错误。它在安装w3缓存插件后出现。我在这里查看了坏标志分隔符问题,看起来最可能出现的问题是不需要的额外问题。但我不知道该寻找什么。非常感谢您对我的问题有所了解。

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>
# END W3TC Browser Cache

1 个答案:

答案 0 :(得分:1)

这条线似乎是杯子:

RewriteRule . index.php [L]# BEGIN W3TC Browser Cache

将其更改为:

RewriteRule . index.php [L]

由于RewriteRule语法不允许内联注释。