mod_rewrite seems to ignore [L] flag

后端 未结 2 2036
一整个雨季
一整个雨季 2021-01-15 01:50

I\'m trying to use the [L] flag in RewriteRule, but it doesn\'t seem to work. I\'d like that if you call the page:

www.domain.com/admin         


        
2条回答
  •  余生分开走
    2021-01-15 02:40

    Your second rule is strange. I do not know what you are attempting to do by putting $1 as the value you are checking your condition against. It should probably look like this:

    RewriteEngine on
    
    RewriteRule ^admin/(.*) /backend.php/$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} !^(index\.php|admin|assets|images|uploads|robots\.txt|backend\.php)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    Note I have also added a pass-through for backend.php

提交回复
热议问题