Is rewriteCond doesn't work with semicolon?

冷暖自知 提交于 2019-12-25 06:13:12

问题


I've ask this rewrite rule for Everything but certain pattern question.

Well, the problem is still the same. I have the following htaccess:

<IfModule mod_rewrite.c>
    # Options +FollowSymLinks -Indexes
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} "forum/" [OR]
    RewriteCond %{REQUEST_URI} "forum"
    RewriteRule (.*) $1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteCond %{REQUEST_URI} !^/forum
    RewriteRule (?!^forum(?:/.*|)$)^(.*)$ /index.php/$1 [L,NC,QSA]
</IfModule>

And this directory structure:

public_html
 |--- /forum
 |--- /assets
 |--- /application
 |--- /system
 |--- index.php
 |--- .htaccess

forum subdirectory has Simple Machine Forum installed, while the root directory has CodeIgniter installed.

Basically, I want if someone accessing http://getnocms.com/something, it will be rewritten into http://getnocms.com/index.php/something.

But, if someone accessing http://getnocms.com/forum, I don't want any rewrite rule applied.

Well, it actually work. But the strange phenomenon happens when I try to access: http://www.getnocms.com/forum/index.php?action=admin;area=manageboards;sa=newcat;feb4219=bea74b1ac6aace220b204cb50a5d5027 This way, the CodeIgniter seems to take over and show 404 not found page. However if I edit the address bar into this: http://www.getnocms.com/forum/index.php?action=admin&area=manageboards&sa=newcat&feb4219=bea74b1ac6aace220b204cb50a5d5027 It run correctly (the smf handle the request)

I come into sudden conclusion that rewriteCond doesn't work with semicolon. Is that right?

来源:https://stackoverflow.com/questions/16631786/is-rewritecond-doesnt-work-with-semicolon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!