amazedinc
amazedinc

Reputation: 418

Mod-Rewrite exclude a specific link from rewrite

I have a very simple mod rewrite script taking my php variables and making them into .html files. It works however, I would like to confirm my google webmaster tools url, and it is not working because the url structure is being rewritten. How can i exclude a specific item?

RewriteEngine On
RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L]

URL i would like to exclude from the rewrite process:

http://www.website.com/google149e37e6d0ddce9a.html

Thank you in advance!

Upvotes: 1

Views: 1109

Answers (2)

Zeki
Zeki

Reputation: 5276

I'd suggest you use something like:

RewriteRule ^google[0-9a-f]+.html$ - [L]

So that you can upload verification files later and not have this problem.

Upvotes: 2

Alex
Alex

Reputation: 1087

RewriteEngine On
RewriteRule ^google149e37e6d0ddce9a.html$ - [L]
RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L]

The dash is a special value meaning nothing will be rewritten. The [L] stops evaluation upon a successful match.

Upvotes: 3

Related Questions