【发布时间】:2010-11-26 18:17:18
【问题描述】:
从 .htaccess 文件的重写规则中排除一个或多个目录似乎是一个常见问题。但是,我的 .htaccess 不仅仅是设置重写规则。我还设置了一些服务器更改(我们在此服务器上没有 suPHP)以及设置一些 php 文件的前置。例如,以下是一些示例:
# Make files ending in .php, .html and .xml files etc. parsed by php.
AddType application/x-httpd-php .php .html .xml .css .js .le .txt
<FilesMatch "\.html$">
php_value auto_prepend_file "/home/2427/spwebsites/www.spwebsites.co.uk/incs/phps/config.php"
</FilesMatch>
# Internal Server Error
ErrorDocument 500 /admin/errors.html?code=500
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-]+)/$ $1.html [L]
我不想为一个目录(我的 word press 安装所在的位置)设置任何这些,有没有办法可以做到这一点?我可以为整个 .htaccess 文件设置条件语句吗?
在 word press 目录中添加空白 .htaccess 文件将不起作用,因为这不会撤消父目录中的设置。
【问题讨论】:
标签: apache wordpress .htaccess mod-rewrite