homepage Welcome to WebmasterWorld Guest from 54.196.24.103
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Please help with Redirect
ricksterguy




msg:4550636
 12:45 pm on Mar 3, 2013 (gmt 0)

I did a search on the term redirect and tried some of the things explained in the posts I found, but I just can't get this to work.

I have an aged WordPress blog with over 500 pages indexed in Google that I no longer want to make available to the public. The domain is example.com where example is my first and last name. This blog is hosted on a shared Linux server from Hostgator.

I have another relatively new WordPress blog that is hosted on a dedicated Linux server, also with Hostgator. What I'm trying to do is redirect all search engine traffic from all pages indexed in Google for the old domain to the home page of the other blog.

In other words I need to do a redirect from all pages of domain #1 to the index page of domain #2 which is on a different server.

I've tried everything from simple "Redirect 301" statements to complicated rewrite rules in .htaccess and the old pages ALWAYS try to redirect to a corresponding page on the new site (which of course do not exist and never will, resulting in a 404 error). Right now the 404 page on the new blog is catching all the traffic to the non-existent pages but I would really prefer having it redirected straight to the home page if possible (and I realize that it might not be).

Help with the coding of a redirect that works the way I need it to work will be GREATLY appreciated. Thanks in advance, and sorry for the rambling explanation!

 

g1smd




msg:4550646
 1:41 pm on Mar 3, 2013 (gmt 0)

What code have you tried so far?

ricksterguy




msg:4550648
 1:55 pm on Mar 3, 2013 (gmt 0)

This is what I'm using now as a catch-all:

Redirect 301 / [newdomain.com...]

I have also tried this:

RewriteEngine On
RewriteRule ^(.*)$ [newdomain.com...] [R=301]

and this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.olddomain.com$
RewriteRule ^(.*)$ [mydomain.com...] [R=301,L]

Everything I've tried attempts to redirect the old page to a corresponding page on the new domain which results in a 404 error.

phranque




msg:4550693
 5:47 pm on Mar 3, 2013 (gmt 0)

welcome to WebmasterWorld, ricksterguy!

your server access and error logs on the new domain server may tell you what the problem is.

lucy24




msg:4550748
 11:30 pm on Mar 3, 2013 (gmt 0)

If I'm reading your first post correctly, the two domains live in different places-- different physical servers, even --so requests for Old Blog and requests for New Blog will never set eyes on each other. This simplifies things a lot.

The one thing you don't say is where your attempted redirects are located. If they are anywhere other than the old site's htaccess, requests will never see them so they can have no effect.

A Redirect by that name will not work. You can use RedirectMatch if and only if the old site does not use mod_rewrite at all. If it does, you will have to make your redirect using mod_rewrite. But that's trivial.

The most important thing is getting the redirect rule in the right location.

:: pause here to admire the way everyone is sitting on their hands w/r/t the "redirect everything to home page" aspect ;) ::

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved