如何进行 mod 重写以更改 url 的符号以用于显示目的?
大家好,
我一直在想,谷歌搜索并更快地思考是否有可能 mod 重写将其从 url 获取的特定符号更改为其他符号?
即如果网址是 www.website.com/foo-bar 使用重写规则我可以让连字符变成正斜杠?
<?php $foobar = "foo-bar"; ?>
<a href="/<?php echo $foobar; ?>">foo-bar</a>
.htacces 代码我有..
RewriteRule ^([^/]+)$ index.php?page=$1 [L]
所以基本上我想 mod 重写以使地址栏上的 url 显示为 www.website.com/foo/bar 如果可能的话?
问候,
丹。
Good day all,
Ive been wondering, google searching and goign greyer quicker thinking if it is possible for mod rewrite to change a specific symbol it grabs from the url to something else?
i.e. if the url is www.website.com/foo-bar using the rewriterule I can get that hyphen to become a forward slash?
<?php $foobar = "foo-bar"; ?>
<a href="/<?php echo $foobar; ?>">foo-bar</a>
.htacces code I have..
RewriteRule ^([^/]+)$ index.php?page=$1 [L]
So basically I would like mod rewrite to make the url display on the addressbar as www.website.com/foo/bar if possible?
Regards,
Dan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这个:
http://forum.modrewrite.com/viewtopic.php?t =2799
Have a look at this:
http://forum.modrewrite.com/viewtopic.php?t=2799