特定文件夹的 codeigniter htaccess 异常
下面是我用于 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 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>
Below is my htaccess file for codeigniter setup , which converts a/b to index.php/a/b
However, I want to add an exception that if a=cometchat then, it will not do the rewrite.
Please help
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加此行:
在每个
RewriteRule
上方,并更改/添加文件夹。所以:
Add this line:
above each
RewriteRule
, and change/add folders.so: