Catch all .htaccess - only if nothing is found bef

2019-07-19 21:49发布

Is it possible to have exceptions to a catch all regex in a .htaccess file ?

Here is my current .htaccess file

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ see.php?url=$1 [L]

I would like to have some exceptions to the catch all regex and only use it in the last case, if nothing is found before.

I tried to play with RewriteCond, but I weren't able to make this work.

Edit: I would like exceptions to be rewrited as well, it this possible ?

1条回答
女痞
2楼-- · 2019-07-19 22:42

Anything you place in the .htaccess file before the catch all rewrite will be executed first. So if you put an [L] flag on those rewrites then the processing stops there and the the catch all rewrite will not fire.

Make sense?

查看更多
登录 后发表回答