How to only allow users to a page through a rewrite?
- by Pietu1998
I have a website where I am using SSI to include some stuff to the front page. However, I'd like to show users an URL that ends with .html. I have accomplished that via a .htaccess and mod_rewrite redirect.
RewriteRule ^index\.html$ index.shtml [PT,L]
Also, I am using another redirect pointing to this URL to internally load the pages' content with JavaScript (example.html to index.html#example.html) with a condition for not redirecting index.html.
Now, I'd like to make the .shtml page 403 Forbidden. This is also easy:
RewriteRule ^index\.shtml - [F]
But, now index.html also gets forbidden.
I have tried adding L to the .html-to-.shtml rule, but this doesn't help. How could this problem be solved?