Catch all .htaccess - only if nothing is found before

拜拜、爱过 提交于 2019-12-11 03:32:07

问题


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:


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?



来源:https://stackoverflow.com/questions/9842027/catch-all-htaccess-only-if-nothing-is-found-before

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