开发者

How to get mod rewrite to change an url's symbol for display purposes?

开发者 https://www.devze.com 2023-01-24 22:32 出处:网络
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?

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.


Have a look at this:

http://forum.modrewrite.com/viewtopic.php?t=2799

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号