Forum Moderators: phranque

Message Too Old, No Replies

Clean URLs

         

blondmark

7:58 pm on Oct 4, 2006 (gmt 0)

10+ Year Member



Please could anyone think of a way to solve this on an apache server using a MYSQL database?:

The user wants to see the profile of a member of a dating site called john by just putting "www.site.com/john"

But it needs to redirect to where john's profile really is, which is "www.site.com/index.php?prof_name=john"

Is there any way, with a mod rewrite or whatever, to redirect the user to the correct URL by, for example, automatically adding "index.php?prof_name=" after every slash and before every username?

Thanks in advance for any suggestions ...

jdMorgan

8:27 pm on Oct 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Changing dynamic to static URLs [webmasterworld.com] - A basic introduction to using mod_rewrite on Apache server to implement search-engine-friendly static URLs on dynamically-generated sites, located in our Apache forum library.

Jim

blondmark

9:01 pm on Oct 4, 2006 (gmt 0)

10+ Year Member



Many thanks for this your advice Jim.

Reading through this post, I can see how a URL such as

"www.site.com/index.php?prof_name=john"

could redirect to

"www.site.com/john"

but could a mod rewrite actually do this the other way around?

i.e. "www.site.com/john" --> "www.site.com/index.php?prof_name=john"

If so, then problem solved! :o)

jdMorgan

9:07 pm on Oct 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you need to review that post again, in detail, as that's just what was discussed.

Jim

blondmark

9:23 pm on Oct 4, 2006 (gmt 0)

10+ Year Member



Thanks Jim! I'm most grateful to you :o)