设置HTACCESS以排除重写某个文件夹的URL

时间:2010-09-29 09:40:18

标签: .htaccess

大家好我有一个htaccess文件设置如下,它将url参数转换为易于使用的URL,即index.php?customer = 2成为index / customer / 2

RewriteEngine on

RewriteCond %{HTTP_HOST} ^fltdata.com [NC]
RewriteRule (.*) http://www.fltdata.com/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php
RewriteRule !\.(js|ico|gif|jpg|png|css|htm|html)$ index.php 

php_flag magic_quotes_gpc Off

AddType text/css .css
AddHandler php5-script .php

我想设置它以便它排除某个测试文件夹,这样如果我输入让我们说mysite.com/test它会打开一个测试文件夹,而不是像参数一样对待它。任何想法

1 个答案:

答案 0 :(得分:0)

添加:RewriteCond %{REQUEST_FILENAME} -d应该使“真实”文件夹优先于重写。