Forum Moderators: phranque

Message Too Old, No Replies

htaccess redirect url

         

studiosx

11:46 pm on Mar 21, 2014 (gmt 0)

10+ Year Member



I have hundreds of links like this:

http://www.domain.com/index.php?tag=value


I want to redirect all links to

http://www.domain.com/value/


Example:

Link1
http://www.domain.com/index.php?tag=LW1fdX49tR
redirect to:
http://www.domain.com/LW1fdX49tR/


Link2
http://www.domain.com/index.php?tag=A3kh0QLIrc
redirect to:
http://www.domain.com/A3kh0QLIrc/


Link3
http://www.domain.com/index.php?tag=vXwNR4U9qY
redirect to:
http://www.domain.com/vXwNR4U9qY/


etc

How can I do that? Thank you!

lucy24

12:43 am on Mar 22, 2014 (gmt 0)

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



What have you tried so far? You're describing the basic redirect-to-rewrite two-step, which comes up in this forum about once a week. So you'll find lots of starting points. Especially since it looks as if you've got the simple version-- the one that can be done in mod_rewrite alone, without recourse to a php script.

:: insert Why We Make You Do It Yourself* boilerplate ::


* This really exists, but I rarely post it because it makes people mad.

tangor

1:08 am on Mar 22, 2014 (gmt 0)

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



There are some advantages to cleaning up URLs... but that only makes sense if the site is suffering in either response time or SE indexing. There's nothing wrong with any of the above.