View Full Version : Move traffic from /forum directory to root
Hell³
08-02-2006, 10:38 AM
Ok, so I got rid of my portal and moved my forums from it's own directory to the site's root. I would like to redirect all traffic that goes to www.mysite.com/forum to www.mysite.com/
For what I've read here I think I should use a 301 redirect for that, but honestly I haven't really studied it's format, and I'm not really sure if that's what I must do. And if it is so, then what should I have to exactly write. I would be gratefull for any help.
Big Dan
08-02-2006, 11:02 AM
I just read an article on this and impletmented a basic 404 error fix
http://www.javascriptkit.com/howto/htaccess7.shtml
Noppid
08-02-2006, 11:12 AM
Try this...
RewriteEngine on
RewriteRule ^forum/(.*) http://www.example.com/$1 [R=301,L]
Replace example.com with you domain name.
Hell³
08-02-2006, 11:28 AM
Thank you both. I'll put the 301 right now.
I might try the 404 error fix with some of my indexed pages, wich now I'm glad there are few :D
Hell³
08-02-2006, 11:41 AM
Well, the 301 didn't worked. But the 404 redirect worked flawlessly. Thank you both again.
Noppid
08-02-2006, 02:23 PM
Well, the 301 didn't worked. But the 404 redirect worked flawlessly. Thank you both again.
PM me your htaccess file, you want a 301, not a 404 for the best SEO. Show me how you made the code look as when you added this to the htaccess as well.
I use this on a few sites with good results.
Hell³
08-02-2006, 03:04 PM
Thank you for the help noppid, pm sent.
Brandon Sheley
08-02-2006, 03:59 PM
this is what i used on locoforum when i changed some stuff and wanted to point all old links to the main
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* http://www.locoforum.com/ [L,R=301]
Hell³
08-19-2006, 02:44 PM
After doing some cleaning on my .htaccess, noppid's 301 redirect worked perfectly. Thanks again to everyone who helped with this :)
Noppid
08-19-2006, 02:59 PM
I have to admit, I'm no htaccess expert. That is something I looked up and shared. But I'm glad to see it works as well for you as it does for me. :)
Hell³
09-06-2006, 06:06 PM
I'm back for more :rolleyes:, apparently the server one day decided to not to let this code work anymore :(, here are the actual contents of my .htaccess
RewriteEngine On
RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteEngine on
RewriteRule ^foros/(.*) http://www.deuterio.net/$1 [R=301,L]
Last time I checked the redirect worked fine. But today I was investigating the way to also redirect subdomains requests to the main domain. I found this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain1\.maindomain\.com)$ [NC,OR]
RewriteCond %{HTTP_HOST} ^subdomain2\.maindomain\.com)$ [NC]
RewriteRule ^(.*)$ http://www.maindomain.com/$1 [R=301] Before adding this I checked the other redirect to see if it was working, and lo and behold, it didn't, any ideas?
Powered by vBulletin® Version 4.2.0 Alpha 1 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.