Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.Htaccess是否将所有文件重写为友好url,除非文件夹名为。。?_.htaccess_Seo - Fatal编程技术网

.Htaccess是否将所有文件重写为友好url,除非文件夹名为。。?

.Htaccess是否将所有文件重写为友好url,除非文件夹名为。。?,.htaccess,seo,.htaccess,Seo,我有一个重写: RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|js|etc|flv|swf|mp4|mov)$ [NC] RewriteRule ^([^/]*)/([^/]*)$ /detail.php?type=$1&url=$2 [L] 它将site.com/detail.php?type=2&url=3重写为site.com/type/url 现在我有了一个文件夹,site.com/admin/,当我输入site.com/adm

我有一个重写:

RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|js|etc|flv|swf|mp4|mov)$ [NC]

RewriteRule ^([^/]*)/([^/]*)$ /detail.php?type=$1&url=$2 [L]
它将
site.com/detail.php?type=2&url=3
重写为
site.com/type/url


现在我有了一个文件夹,
site.com/admin/
,当我输入
site.com/admin/
时,由于htaccess的原因,它会将我发送到一个重写页面,如果文件夹名为admin,我如何防止htaccess重写工作?

添加另一个重写条件以排除admin文件夹

#exclude /admin/ folder
RewriteCond %{REQUEST_URI} !^/admin/
RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|js|etc|flv|swf|mp4|mov)$ [NC]
RewriteRule ^([^/]*)/([^/]*)$ /detail.php?type=$1&url=$2 [L]