Forum Moderators: phranque

Message Too Old, No Replies

content being redirected, url is not

         

wheel

4:50 pm on Apr 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm moving site A to site b (and site b is a new site) so I wanted to move everything from a, to b. To that end, I put the following in my apache file:
<VirtualHost *:80>
ServerName www.domainA.com
Redirect 301 / [domainb.com...]
</VirtualHost>

But when I type in www.domaina.com, I see the content for domain b, the the url doesn't change - I'm still at domain a.

Any ideas on what I'm missing? I'd like to actually bounce the url to domain b, I figured that's what a 301 did.

g1smd

5:28 pm on Apr 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



"Moving a site"

Is this moving the physical files from one server to another, or staying on the same server and just re-assigning a new domain name to that existing server?

The correct answer depends on both of those factors.

You'll need a redirect.

This standard code might work:

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

[edited by: jdMorgan at 8:41 pm (utc) on Apr 10, 2010]
[edit reason] Fixed typo [/edit]

wheel

6:14 pm on Apr 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm on the same server, I'm moving domain names. So I want users and the SE's, when they type in www.domaina.com, to bounce to www.domainb.com

g1smd

6:38 pm on Apr 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Point all domains to one folder on the server, and install the code above.

It will redirect any domain name request that is not exactly "www.domain.com".