Is rewriteCond doesn't work with semicolon?

2019-08-26 07:03发布

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?

0条回答
登录 后发表回答