【发布时间】:2011-12-19 07:18:09
【问题描述】:
下面是我用于 codeigniter setup 的 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 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>
【问题讨论】:
-
RewriteCond $1 !^(index\.php|cometchat)是我在 RewruteRule 之前所拥有的(替换为你的例外)
标签: .htaccess codeigniter mod-rewrite rewrite