Forum Moderators: phranque

Message Too Old, No Replies

htaccess redirect with parameters

         

almamun

6:36 pm on Aug 24, 2012 (gmt 0)

10+ Year Member



Hello everybody,
This is my first post in this board.

I want to redirect urls like

site.com/profile?userid=10

to

site.com/profile/10/


Note: here 10 is a user id which and this pattern should work with every user (id).

Could you pls tell me how can I achieve this redirection?

g1smd

7:13 pm on Aug 24, 2012 (gmt 0)

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



As this question or something very close to it is asked at least twice per week for the last ten years, we ask that you browse previous threads then post your best effort code after researching from the material that has taken thousands of man hours to post.

I could just cut and paste the answer from the other day, but you'll learn so much more by reading dozens of posts and figuring out the various ways other people tried and how they optimised their methods...

The redirect/rewrite pair (each one using a RewriteRule) that you need is just a few lines of code.