mod-rewrite 转发而不更改 URL [英] mod-rewrite forwarding without changing URL

查看:24
本文介绍了mod-rewrite 转发而不更改 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建漂亮"URL 时,我的 Apache 配置有一个小问题.我已经到了输入(或链接)到

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

将您转至

index.php?pageID=Forside

index.php?pageID=Forside

这正是我想要的.但是如何让 index.html 留在浏览器的地址栏中?现在它转发并将 URL 更改为原始 URL.

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.

这里是我的 .htaccess:

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]

在有人对此发表评论之前:缺少 Options +FollowSymLinks,因为它在 one.com 网络酒店上触发了错误 500.

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

提前致谢!

推荐答案

尝试以下操作:

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

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

I think this may help you to resolve your problem.

这篇关于mod-rewrite 转发而不更改 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆