Welcome to WebmasterWorld Guest from 54.145.144.101

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Another 301 Redirect Question.

   
9:16 pm on Oct 22, 2011 (gmt 0)

5+ Year Member



I searched and couldn't find my answer.

I am trying to .htaccess 301 redirect and entire website to the index of a new website. So basically I want every page of the old website pointing to the index page of my new website.

I though this would be easy and this is what I'm using:

Redirect 301 / http://www.site.org/


Both websites are using Wordpress. When I visit any URL of the old website excluding the index it takes me to a 404 page on the new website instead of the index page.


Thanks in advance.
10:16 pm on Oct 22, 2011 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



You need to get a firm grip on the difference between mod_alias (what you're using here) and mod_rewrite.

One key difference: Redirects made using mod_alias will reappend the rest of the path. So when you say

Redirect 301 / http://www.example.com/

it really means

Redirect 301 {/blahblah} http://www.example.com{/sameblahblah}

There are times when mod_alias is appropriate* but what you want here is

RewriteEngine On

RewriteRule .* http://www.example.com/ [R=301,L]


* Apache says so. [httpd.apache.org]
10:24 pm on Oct 22, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



SEO wise, it is generally bad form to funnel multiple pages via a redirect to a single target URL, especially so if that target is the root.

Much better would be a one-to-one 301 redirect of old page to equivalent new page.
10:36 pm on Oct 22, 2011 (gmt 0)

5+ Year Member



Thanks lucy24 but I should have mentioned I tried what you suggested and:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) [newdomain.com...] [R=301,L]

Neither of these options work and both product the same result described in my original post.

g1smd there are no equivalent pages on the new site. I'm killing the whole site and want to funnel all the traffic to the index of the new site.
10:42 pm on Oct 22, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Use example.com on this forum to stop URL auto-linking.

The RewriteRule code should have worked exactly as you wanted. Is mod_rewrite enabled on that server?

You don't need to pay for two hosting plans. Point both domains at the one server. Install a redirect so that when the request is for the wrong hostname, the server sends a redirect to the correct hostname. When the new request arrives at the same server, but this time for the right hostname, the content is served.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month