Forum Moderators: phranque
<FilesMatch "\.(html)$">
RewriteEngine on
Rewritecond %{http_cookie} !^.* SecuityFlag *
RewriteRule ^(.*)$ www.google.com
</FilesMatch>
This code work fine but it has following two problems
(1)On RewriteRule I want to throw 403
(2)Currently RewriteRule only able to forward request to external URL like www.google.com. Instead of that if I try to forward to \error.html, it throws 400 error.
Please review my above code and let me what changes I need to do.
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !SecuityFlag
RewriteCond %{REQUEST_URI} !^/[i]path-to-403-error-document.html[/i]$
RewriteRule \.html$ - [F]
Note spelling of "SecuityFlag" as in your post above. Is that supposed to be "SecurityFlag?"
Jim
I have another requirement where I need to exempt around 10 HTML pages from this RewriteRule. In future, I may like to add some more files in exempted list. How to achieve this? Can I provide a file which contain list if URLs/files to be exempted?