Forum Moderators: Robert Charlton & goodroi
I'm 301 redirecting an established domain to another for rebranding purposes. We're doing this to gain a more brand-able name.
A concern is obviously Google. We have 30,000 visitors a day, so a lot to lose if this goes wrong.
I've acquired an already established, related domain. One issue is the website was established under subdomain.sitename.com rather than www.
The obvious answer would be to 301 to www. But then the URL's will conflict with the URLs of the website that it's being 301 redirected to.
Would it make sense at this point to 301 to www.sitename.com/subfolder and have a single link in the navigation, that leads back to www.sitename.com as well as limit link juice routes in an attempt to filter as much of the link juice to the live website at /
Any advice would be appreciated. I'm a little unsure what to do with this one.
Thanks.
If it's done correctly they hit the old URL and land on the new one... Not sure how it matters from one site or two and there's a workaround for about everything, including determining the originally requested URL, so I'm at a loss on this one.
I have a successful website with almost 2 million members and a few hundred thousand pages of content, but the URL contains the word forum, which is exactly what the website was to begin with, but has become so much more. It leads advertisers and potential members to all the wrong conclusions. Both myself and my community want a new name that better reflects who we are and what we offer.
We settled on a name but it was already taken by a website, already established within our niche, it had good content and PR. We come to a deal and acquired the new website, who's name we'll be using. It works for the that the new domain is already established as I'd not 301 redirect to a brand spanking new domain without first establishing it.
However, the new website and URL I acquired has been established at subdomain.domain.com rather than www.domain.com which is definitely what we'll be using. I would like to establish the www. of the new domain before I go ahead and 301 redirect our current URL to this new one.
At first I figured it was quite straight forward, 301 redirect the newly acquired websites subdomain to www.?
BUT at no point, do I want to lose the content or links of the newly acquired domain. Both the new and old website run from powerful CMS, with complex .htaccess files. They can't both coexist at www.newdomain.com, at least not without lots and lots of messing around.
I figured rather than 301 redirecting the new website from subdomain to www.newdomain.com I might as well 301 redirect it to www.newdomain.com/randomfoldername where it can stay and not interfere with my website when I finally come to 301 redirect www.currentdomain.com to www.newdomain.com
I really hope I've made more sense this time around as I'd love some feedback, it's given me quite a headache.
Thanks,
Make sure that the response is 301, not 302.
It is also not a good idea to 'funnel' a large number of redirects to a single destination URL. It is best to arrange redirects so that the request for a 'page' on the old domain is redirected to the same, or a related, page on the new domain.
It is best to arrange redirects so that the request for a 'page' on the old domain is redirected to the same, or a related, page on the new domain.
I agree. Though there are thousands of pages to cater for. But possibly worth taking the time to do. hmm
The pages on the new domain have links to related resources as well as other links to related content internally. My idea was to just have one main navigation link that went to /
RewriteCond %{HTTP_HOST} ^subdomain\.newdomain\.com
RewriteCond %{REQUEST_URI}!^/newfolder/
Rewriterule ^(.*)$ /newfolder/$1 [L]
Which does what I want, but is it the best method?
btw
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com [NC]
RewriteRule (.*) http://www.example.com/folder$1 [R=301,L]
will not work. It redirects from subdomain.example.com to www.example.com rather than to www.example.com/folder?
You have two options I see:
1.) Leave subdomain.example.com as is.
Combine the two .htaccess files into one.
Put the most accessed domain's .htaccess file on top.
Count the rules in the file.
(Carefully. NOT Conditions. Rules Only.)
Add this rule to the top of the .htaccess file:
(Assuming www.example.com's Mod_Rewrite is on top.)
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$
RewriteRule .? - [S=NumberOfRulesInTheOriginalFile]
This tells Mod_Rewrite to Skip the number of rules following S= for subdomain.example.com and continue processing for all other domain / subdomain variations. If you put the Mod_Rewrite for subdomain.example.com on top, you would simply change it to:
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule .? - [S=NumberOfRulesInTheOriginalFile]
2.) Redirect subdomain.example.com to something like www.example.com/subdomain/ with something like:
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$
RewriteRule .? http://www.example.com/subdomain%{REQUEST_URI} [R=301,L]
Then drop the .htaccess from subdomain.example.com into the directory /subdomain/ and change the root .htaccess to what you will use for www.example.com. (Keep in mind, you will probably need to adjust the 'subdomain' .htaccess slightly to function properly in the directory, rather than the root.)
Either way, a rule or two in your .htaccess is all you should need, and a link on the home page for older browsers, which do not send a host header and will probably end up at www.example.com with 'Looking For Subdomain.Example.Com? Click Here' might be a good idea...
As far as the timing goes?
I'll leave that to you.
ADDED:
We were posting at the same time, so I'm just now reading yours... There could be some redundancy or unnecessary information in what I said.
Hmmm... It almost sounds like a rule order issue to me, because it should work correctly. Put it at the top, and if it still gives you issues, try adding this rule after:
RewriteRule ^folder/ - [L]
For some reason.
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com$
RewriteRule .? http://www.example.com/subdomain%{REQUEST_URI} [R=301,L]
goes to http://www.example.com and won't goto the subdomain and so I have to add
Rewriterule ^(.*)$ /subdomain/$1 [L] but then I think it will be classed as 2 redirects and I know Google won't like that.
RE your last post: Fascinating.
Let me think a minute.
That's the only rule in there?
I wonder if something in the CMS setup is overriding stuff...
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/test/$1 [R=301,L] actually redirects to the folder but keeps adding testtesttesttesttest to the url until the browser gives up. My goodness I suck with htaccess!
[edited by: Robert_Charlton at 7:26 pm (utc) on Sep. 25, 2009]
[edit reason] changed to example.com - it can never be owned [/edit]
I wonder if something in the CMS setup is overriding stuff...
That or lightspeed would be my guess. You're trying to do some really basic stuff and it should be working... It's not your mod_rewriting ability if you only have one rule in the file or you put what I told you to in and that was the only thing in there and it didn't work. The worst you should expect from mine is a 500 server error, and in looking at it I don't see a server error. It should Not do what you are describing...
If what I sent you really redirected to http://www.example.com without a / when you used %{REQUEST_URI} then there is a configuration on your server that is different than Apache, which would indicate to me lightspeed is part of your issue, because with standard Apache, the preceding / should be included in %{REQUEST_URI}, even in the .htaccess file.
Just for fun, maybe put up a PHP page EG test.php with <?=$_SERVER['REQUEST_URI']?> and see what you get. It should be the same as you get in the .htaccess with Mod_Rewrite. (It should 'echo' /test.php)
Probably a stupid error on my part. I had tried the htaccess inside /public_html/ (www.) and also /public_html/folder/ where the files for the domain live.
I thought the subdomain was mapped to public_html however it was mapped to public_html/subdomain/. The htaccess needed to be in public_html/subdomain/
Now at 10:32am, 2 days after waking up, I can sleep! woo.
Thanks so much for your help jd01
Somehow, somewhere between my fiddling with the htaccess, Google indexed the homepage as [subdomain.domain.com...] ... crap.
I don't think I can easily add a 301 for this, as it doesn't really exist anywhere. Shall I leave it and wait for Google to realise or should I take action?
So we're all set now. Now just to figure out how long to let it settle before 301 my main to to www.domain.com! :D
Thanks again for all your help with this. htaccess for me, is one of my biggest nightmares.
Thanks again for all your help with this. htaccess for me, is one of my biggest nightmares.
Yeah, it took me quite a while to really get into it, and we should both really be thanking jdMorgan and WebmasterWorld too, because I mainly learned Mod_Rewrite by reading jdMorgan's posts here in the Apache Forum! [webmasterworld.com]
I'm glad you got things working...
Personally, as far as timing goes, I would probably just wait for the redirects to kickin in the results and then make the move, but it's not my neck on the line, so use your best judgment... I actually usually try to do what the 'normal' person who doesn't 'over think it' would, because that's the 'most natural' thing to do and 'natural behavior' seems to count. (I might even just do it all at once, especially with a 'type in' user-base who know where the site is, but again, it's not my decision or traffic.)
Edited: Couldn't type what I meant or wanted to say repeatedly.
Edited: Couldn't type what I meant or wanted to say repeatedly.
You must have caught the bug I had yesterday.
I'm definitely with you on "doing things naturally", helps with my impatience too. Perhaps go for the middle ground, wait for the first lot of redirects to kick in, 301 my current domain, close my eyes and pray to Google god to forgive me for my sins!