在创建“漂亮”URL 时,我的 Apache 配置有一个小问题。我已经到了输入(或链接)到
的阶段index.html
将您转发至
index.php?pageID=Forside
这正是我想要的。 但是如何让index.html保留在浏览器的地址栏中呢? 现在它会将 URL 转发并更改为原始 URL。
这是我的.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]
在有人评论之前:Options +FollowSymLinks 缺失,因为它会在 one.com 网络酒店上触发错误 500。
提前致谢!
最佳答案
尝试以下操作:
RewriteEngine On
RewriteRule ^index\.html$ /index.php?pageID=Forside [L]
我认为这可以帮助您解决问题。
关于.htaccess - mod-rewrite 转发而不改变 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14171293/