Search code examples
.htaccessseoapache2url-encoding

mod-rewrite forwarding without changing URL


I have a small problem with my Apache configuration when creating "pretty" URLs. I've got it to the stage where typing (or linkig for that matter) to

index.html

forwards you to

index.php?pageID=Forside

that is exactly what I want. But how can I get index.html to stay in the address bar of the browser? Right now it forwards and changes the URL to the original one.

Here my .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} index\.html
RewriteRule .* http://www.radoor-designs.dk/index.php?pageID=Forside [L]

And before someone comments on it: Options +FollowSymLinks is missing since it triggers an error 500 on a one.com webhotel.

Thanks in advance!


Solution

  • Try the following:

    RewriteEngine On
    RewriteRule ^index\.html$ /index.php?pageID=Forside [L]
    

    I think this may help you to resolve your problem.