2

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!

4

3 回答 3

4

尝试以下操作:

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

我认为这可以帮助您解决问题。

于 2013-01-05T11:37:02.607 回答
1
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^index.html$  /index.php?pageID=Forside [L]

这将为您执行重定向,同时在浏览器窗口中显示 index.html。

于 2013-01-05T11:41:09.600 回答
0

奇怪的是符号链接会创建一个错误 500,如果你希望它重定向到 index.html?pageID=Forside 然后做

RewriteRule .* /index.html?pageID=Forside [QSA,L,R=301]

我不能 100% 确定你想用这个实现什么,你能解释一下吗?

于 2013-01-05T11:28:40.497 回答