PDA

View Full Version : How can I redirect this link using htaccess ?


sadiq6210
05-10-2013, 09:03 PM
The link was like this:
http://www.donaim.com/forum/t1000-5/

where 1000 is the thread id and 5 is the page#

I want to redirect it to
http://www.domain.com/forum/showthread.php?t=1000&page=5


I tried this:
RewriteRule ^t([0-9]+-[0-9]+)/$ http://www.domain.com/forum/showthread.php?t=$1 [L,R=301]


But it is redirected to:
http://www.domain.com/forum/showthread.php?t=1000-5

I want it like (showthread.php?t=1000&page=5)

Any idea?

sadiq6210
05-11-2013, 07:15 AM
I solved it

If anybody need this in future, this is the code

RewriteRule ^t([0-9]+)-([0-9]+)/$ http://www.domain.com/forum/showthread.php?t=$1&page=$2 [L,R=301]
RewriteRule ^t([0-9]+)/$ http://www.domain.com/forum/showthread.php?t=$1 [L,R=301]

ForceHSS
05-11-2013, 08:23 AM
Why you want it to go to a thread never seen anyone make there htaccess file this way

sadiq6210
05-11-2013, 07:56 PM
Why you want it to go to a thread never seen anyone make there htaccess file this way

I am not sure what do you mean but if you ask why I need to do this?

I uninstalled VBSEO so I need to redirect the links to the original

JamalFree
05-19-2013, 09:59 PM
thank you for sharing solution sadiq..........