MyBB Community Forums

Full Version: Redirect /showthread.php to /forums/showthread.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
...Move your forums to /forums/? o.o
(2012-02-10, 09:24 AM)Jordan L. Wrote: [ -> ]...Move your forums to /forums/? o.o

Then all google traffic would be dead.
What? Just move your forums to the /forums/ directory and set up a .htaccess redirecting any existing links from the current install towards the same link, but with the included /forums/ path.
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 }
use a base <href> ?
Worked for me to have portal.php loaded in root and yet link everything properly though to /forum/ where MyBB is.
(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, 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.
The [R=301] at the end turns it into a redirect.

http://www.yourhtmlsource.com/sitemanage...iting.html
(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.

Hello,

As Alex Smith said, the [R=301] makes it a redirect. You can't use regex for Redirect, hence the use of RewriteRule.

All the best,
Imad Jomaa.
Pages: 1 2