.htaccess 特定文件夹的codeigniter htaccess异常
下面是我的用于codeigniter设置的htaccess文件,它将a/b转换为index.php/a/b 但是,我想添加一个异常,如果a=cometchat,那么它将不会进行重写 请帮忙.htaccess 特定文件夹的codeigniter htaccess异常,.htaccess,codeigniter,mod-rewrite,rewrite,.htaccess,Codeigniter,Mod Rewrite,Rewrite,下面是我的用于codeigniter设置的htaccess文件,它将a/b转换为index.php/a/b 但是,我想添加一个异常,如果a=cometchat,那么它将不会进行重写 请帮忙 <IfModule mod_rewrite.c> # Make sure directory listing is disabled Options +FollowSymLinks -Indexes RewriteEngine on # Keep people o
<IfModule mod_rewrite.c>
# Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
RewriteEngine on
# Keep people out of codeigniter directory and Git/Mercurial data
RedirectMatch 403 ^/(system|\.git|\.hg).*$
# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
</IfModule>
#确保目录列表已禁用
选项+FollowSymLinks-索引
重新启动发动机
#让人们远离codeigniter目录和Git/Mercurial数据
重定向匹配403^/(system |\.git |\.hg)*$
#通过index.php发送请求(同样,如果是真实的文件或文件夹,则不发送请求)
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
重写规则^(.*)$index.php?/$1[L]
添加此行:
RewriteCond $1 !^(index\.php|folder1|folder2|img|shared)
在每个上方重写规则
,并更改/添加文件夹
因此:
#确保目录列表已禁用
选项+FollowSymLinks-索引
重新启动发动机
#让人们远离codeigniter目录和Git/Mercurial数据
重定向匹配403^/(system |\.git |\.hg)*$
#通过index.php发送请求(同样,如果是真实的文件或文件夹,则不发送请求)
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
1美元^(索引\.php | folder1 | folder2 | img |共享)
重写规则^(.*)$index.php/$1[L]
1美元^(索引\.php | folder1 | folder2 | img |共享)
重写规则^(.*)$index.php?/$1[L]
重写第二个$1^(index\.php | cometchat)
是我在RewruteRule(替换为您的异常)之前拥有的
<IfModule mod_rewrite.c>
# Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
RewriteEngine on
# Keep people out of codeigniter directory and Git/Mercurial data
RedirectMatch 403 ^/(system|\.git|\.hg).*$
# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteCond $1 !^(index\.php|folder1|folder2|img|shared)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_php5.c>
RewriteCond $1 !^(index\.php|folder1|folder2|img|shared)
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
</IfModule>