I'm trying to make a redirection from all files to a template file. But redirects only works when I specify an URL
For example:
Does not work (it does not redirects)
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /template.php?page=$1 [L,QSA]
Works (redirects to http://domain.com/versioned/template.php?page=index.html)
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) http://domain.com/versioned/template.php?page=$1 [L,QSA]
And the second option is change the URL in the browser. I need to keep the original URL.
Thanks
The problem is with
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} -f
If I quit this, it works, but instead of returning the current file in URL, it returns always template.php