简体   繁体   中英

.htaccess: RewriteCond syntax?

I'm using Drupal 6. Typically, when the user requests a URL for which Drupal has no response, it uses index.php as the error document. However, I'd like to suspend this behavior for a specific URL. How can I do this?

   RewriteCond %{REQUEST_FILENAME} !=fail
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_URI} !=/favicon.ico
   RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Where "fail" is the path I want to block. So www.example.com/fail should result in a 404.

Incidentally, what does [L, QSA] do? I've looked at documentation without luck.

QSA = Query String Append
L = Last Rule

it's there

RewriteCond %{REQUEST_URI} ^/fail*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM