Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 特定文件夹的codeigniter htaccess异常_.htaccess_Codeigniter_Mod Rewrite_Rewrite - Fatal编程技术网

.htaccess 特定文件夹的codeigniter htaccess异常

.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

下面是我的用于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>

#确保目录列表已禁用
选项+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>