Forum Moderators: phranque

Message Too Old, No Replies

need help in url rewrite

need help in url rewrite

         

samyphp

5:47 am on Apr 7, 2010 (gmt 0)

10+ Year Member



Hi there,

i need help in dynamic url rewrite.

Dynamic URL:http://www.example.com/index.php?name=samyphp

I want to make the url for SEO and user friendly. As like this
http://www.example.com/samyphp (or)
http://www.example.com/samyphp/ (or)
http://example.com/samyphp (or)
http://example.com/samyphp/

Can anybody help me to write mod_rewrite for this ?

Thanks,
Palanisamy

[edited by: jdMorgan at 1:00 pm (utc) on Apr 7, 2010]
[edit reason] Please use example.com only. [/edit]

jdMorgan

1:06 pm on Apr 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change the links on your pages to link to the friendly URLs.
Add an internal rewrite from these friendly URLs to the script filepath plus query string.
Optionally, add an external redirect from old "unfriendly" URLs, when requested directly by clients only, to the corresponding friendly URLs.

This process is fully-described in the thread entitled Changing Dynamic URLs to Static URLs [webmasterworld.com] in our Apache Forum Library. Our Apache Forum Charter provides links to relevant resources, and describes how to get the most from this forum. Links to both are at the top of this page.

Having reviewed these resources, please post your best effort at coding a solution as a basis for discussion.

Thanks,
Jim

g1smd

2:29 pm on Apr 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Additionally, it is also a very good idea to ensure that only ONE of the 'friendly' URLs can directly access the content, and that requests for any of the other three non-canonical formats are redirected to the canonical format.