RewriteCond to skip rule if file or directory exists

后端 未结 1 905
你的背包
你的背包 2020-12-15 08:08

I am trying to adjust my htacess file to skip the rewrite rule if the file or directory exists, but when the file exists, it changes the URL to something different. I don\'t

相关标签:
1条回答
  • 2020-12-15 08:26

    Remove extra [OR] and have your code like this:

    # If the request is not for a valid directory
    RewriteCond %{REQUEST_FILENAME} !-d
    # If the request is not for a valid file
    RewriteCond %{REQUEST_FILENAME} !-f
    # If the request is not for a valid link
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^project/([^/.]+)/?$ index.php?view=project&project=$1 [L,NC,QSA]
    
    0 讨论(0)
提交回复
热议问题