Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite help

Kindly help

         

suthra

10:22 am on Jul 5, 2005 (gmt 0)

10+ Year Member



Hi guyz, how do i mod rewrite the entire site:
[rate-my-pic.example.com...]

so that the members profile will automatically look like

http://example.com/suthra

instead of

[rate-my-pic.example.com...]

and also the other links in the site.

Kindly help

Any help is grately appreciated.

Regards.,
Sarathy.s

[edited by: jdMorgan at 2:59 am (utc) on July 6, 2005]
[edit reason] Removed specifics per TOS. [/edit]

jdMorgan

3:07 am on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sarathy,

Welcome to WebmasterWorld!

The short answer is that you modify the links on your pages to the shorter, friendly format. Then you use mod_rewrite to detect and rewrite those friendly URLs --when requested from your server-- back to the form needed to run your script.

You can change the URLs on your pages either by modifying your database, or by using preg_replace (on PHP pages).

The process may be backwards from what you expected, but mod_rewrite works after a request is received by your server, and before any content is served or any scripts are run. Therefore, mod_rewrite can only change the *filepath* associated with a requested URL, it does not work as an output filter to change page content on-the-fly.

Try a search on WebmasterWorld for '"Friendly URL" RewriteRule [google.com]' for many threads on this subject.

Jim