开发者

Neater Url Structure

I am using PHP and Apache Server, and I would like to know how I could change my navigation structure from www.website.开发者_运维问答com/?about to www.website.com/#about?


You can't. # denotes the fragment identifier, and it's resolved on the client-side (the browser simply scrolls to the anchor called about). It's not sent to the server.

However, if you want to use e.g. www.website.com/about, then you can do that. You need to use *mod_rewrite*, see the Apache URL rewriting guide.


This website has some great examples. http://www.bloghash.com/2006/12/apache-mod_rewrite-examples/

Exactly what I was looking for.

RewriteEngine on RewriteRule ^([^/.]+)/?$ /index.php?url=$1 [L]

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜