davesherlock
davesherlock

Reputation: 185

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?

Upvotes: 0

Views: 76

Answers (2)

Dave
Dave

Reputation: 1

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]

Upvotes: 0

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272647

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.

Upvotes: 2

Related Questions