Quick 301s Help

acamso

Regular Member
Joined
Sep 22, 2010
Messages
249
Reaction score
89
Hi, I am trying to set up a 301 redirect from an old site to a new site. I want to redirect the entire domain to the index page of the new site.

I set up my .htaccess on the old site like this:

Code:
Redirect 301 / http://newsite.com

But when I browse to, for example, "http://oldsite.com/test", it is redirected to "http://newsite.comtest/"

Thanks
 
You should be able to find what you need here

Code:
http://www.inmotionhosting.com/support/website/redirects/setting-up-a-301-permanent-redirect-via-htaccess
 
I had this same problem for some reason.

I just installed a 301 plugin on the money site so it would 301 every 404 to the homepage.

Im sure its a better fix for it but it wasn't that important for me at the time and I was sleepy.
 
Still no luck..

Heres the htaccess on the new site if you can spot something:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
 
Any ideas anyone? :(
 
What does not work exactly?
Did you try the suggested solutions?

The .htaccess of your new site is kind of irrelevant, you try to redirect the old site, correct?
 
What does not work exactly?
Did you try the suggested solutions?

The .htaccess of your new site is kind of irrelevant, you try to redirect the old site, correct?

Yes tried all of them. Yes redirect from old to new.

The problem is:

"http://oldsite.com/test" ==> "http://newsite.comtest/"

Should be:

"http://oldsite.com/test" ==> "http://newsite.com"
 
For those who have the same issue, I used this for the new site's htaccess:

RewriteOptions inherit


RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^(.*)$ "http\:\/\/oldsite\.com" [R=301,L]
 
This is the correct code to use to do exactly what you want:

Code:
[COLOR=#ff0000][B][FONT=Consolas]RewriteEngine on
[/FONT][/B][/COLOR][B][COLOR=#ff0000]RewriteCond %{http_host} ^www.old.com [NC,OR]
RewriteCond %{http_host} ^old.com [NC]
RewriteRule ^(.*)$ http://www.thenewdomain.org/ [R=301,NC,L][/COLOR][/B]
 
Back
Top