views:

14

answers:

1

I have setup htaccess but i want increase the length of the rule so i need to know can i bypass one files, its currently 4 but i want to extend to 11- file i want to bypass is called shorten.php can i name a file that escapes the rule?

RewriteCond   %{REQUEST_URI} \/([0-9a-z]{4})$ [NC]
RewriteRule   ^(.*) http://www.x/forward.php?%1 [L]
A: 

Yes, you can exclude them with an additional RewriteCond:

RewriteCond $1 !^shorten\.php$
RewriteCond %{REQUEST_URI} \/([0-9a-z]{4})$ [NC]
RewriteRule ^(.*) http://www.x/forward.php?%1 [L]

Now the matched path of RewriteRule must not be shorten.php.

Gumbo
don't forget changing `{4}` into `{4,11}` as well. Also, you want to skip `forward.php` itself. so try `RewriteCond %{REQUEST_FILENAME} !-f` instead (won't math any existing file).
aularon
thanks for 4,11 i clean forgot about that and only reading this now :)
chris