.htaccess的LocationMatch服务器错误 [英] HTAccess LocationMatch Server Error

查看:301
本文介绍了.htaccess的LocationMatch服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用这个的.htaccess 修改的RewriteBase 如果该位置是本地的还是活的服务器

I'm trying to use this .htaccess to change the RewriteBase if the location is local or live server.

Options +FollowSymlinks
RewriteEngine on

<LocationMatch "^/(bbtsrv02)/$">
    #RewriteBase /beta/admin/
</LocationMatch>

RewriteCond %{REQUEST_URI} !index.php$
RewriteCond %{REQUEST_URI} !css/(.*)\.
RewriteCond %{REQUEST_URI} !img/(.*)\.
RewriteCond %{REQUEST_URI} !incs/(.*)\.
RewriteCond %{REQUEST_URI} !js/(.*)\.
RewriteCond %{REQUEST_URI} !upload/(.*)\.
RewriteCond %{REQUEST_URI} !widget/(.*)\.
RewriteRule ^(.*) index.php?_pd=$1 [NC,L]

当我删除 LocationMatch 整个事情重新开始工作。我只需要修改的RewriteBase 现场测试。

As soon as I remove the LocationMatch the whole thing starts working again. I only need to change the RewriteBase for live testing.

推荐答案

&LT; LocationMatch&GT; 指令的不能在.htaccess文件中使用 - - 只有在服务器配置或虚拟主机的上下文

<LocationMatch> directive CANNOT be used in .htaccess file -- only in server config or virtual host context.

<一个href="http://httpd.apache.org/docs/current/mod/core.html#locationmatch">http://httpd.apache.org/docs/current/mod/core.html#locationmatch

这篇关于.htaccess的LocationMatch服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆