2012-02-10, 09:09 AM
I'm adding a content management system to my forum and want all showthread.php?tid=xx hits to be redirecte to /forums/showthread.php?tid=xx - How do I go about doing this?
(2012-02-10, 09:24 AM)Jordan L. Wrote: [ -> ]...Move your forums to /forums/? o.o
(2012-02-10, 10:06 AM)ranjani Wrote: [ -> ]try using redirect thru .htaccess (similar to below)
Redirect 301 /showthread.php /forums/showthread.php { of course, I knew its not a perfect code - let's wait for experts' guidance }
...
RewriteRule ^showthread.php?tid=([0-9]+)$ forums/showthread.php?tid=$1 [R=301]
...
(2012-02-11, 05:16 PM)Imad Jomaa Wrote: [ -> ](2012-02-10, 10:06 AM)ranjani Wrote: [ -> ]try using redirect thru .htaccess (similar to below)
Redirect 301 /showthread.php /forums/showthread.php { of course, I knew its not a perfect code - let's wait for experts' guidance }
A 301 redirect is exactly what you want. If you are using htaccess, the code below will do just fine.
... RewriteRule ^showthread.php?tid=([0-9]+)$ forums/showthread.php?tid=$1 [R=301] ...
All the best,
Imad Jomaa.
(2012-02-11, 06:56 PM)GamerVoid Wrote: [ -> ](2012-02-11, 05:16 PM)Imad Jomaa Wrote: [ -> ](2012-02-10, 10:06 AM)ranjani Wrote: [ -> ]try using redirect thru .htaccess (similar to below)
Redirect 301 /showthread.php /forums/showthread.php { of course, I knew its not a perfect code - let's wait for experts' guidance }
A 301 redirect is exactly what you want. If you are using htaccess, the code below will do just fine.
... RewriteRule ^showthread.php?tid=([0-9]+)$ forums/showthread.php?tid=$1 [R=301] ...
All the best,
Imad Jomaa.
How will a RewriteRule work? Redirect 301 should be part of the code.