I have an old website i'm trying to take over, and it has a bad htaccess file here that I need to adjust to enable 'FOLDERS', instead of routing EVERYTHING.
我有一个旧网站我试图接管,它有一个糟糕的htaccess文件,我需要调整以启用'FOLDERS',而不是路由一切。
So I have a folder called, "RESOURCES", but it's trying to route through the index file with it..... but I need to load the resource folder instead of routing. How do I make an exception?
所以我有一个名为“RESOURCES”的文件夹,但它正试图通过索引文件进行路由.....但我需要加载资源文件夹而不是路由。我如何例外?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.website\.ca$ [NC]
RewriteRule .? http://www.website.ca%{REQUEST_URI} [R=301,L,QSA]
RewriteRule ^(browse)/?$ /browse.php [L,QSA]
RewriteRule ^([\ \+\-0-9a-zA-Z_]+)/?$ /index.php?where=$1 [L,QSA]
#RewriteRule ^([\ \+\-0-9a-zA-Z_]+)/([-0-9a-zA-Z_]+)/([-0-9a-zA-Z_]+)/?$ /index.php?where=$1&what=$2 [L,QSA]
RewriteRule ^(-0-9a-zA-Z_]+)/([-0-9a-zA-Z_]+)/?$ /index.php?where=$1&what=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . / [R=301,L,QSA]
</IfModule>
1 个解决方案
#1
1
Add this rule just below RewriteBase /
在RewriteBase /下面添加此规则
RewriteRule ^RESOURCES/- [L,NC]
This will skip rest of the rewrite rules for folder called RESOURCES
这将跳过名为RESOURCES的文件夹的其余重写规则
To skip all the folders use this rule:
要跳过所有文件夹,请使用以下规则:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^- [L]
#1
1
Add this rule just below RewriteBase /
在RewriteBase /下面添加此规则
RewriteRule ^RESOURCES/- [L,NC]
This will skip rest of the rewrite rules for folder called RESOURCES
这将跳过名为RESOURCES的文件夹的其余重写规则
To skip all the folders use this rule:
要跳过所有文件夹,请使用以下规则:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^- [L]