Forum Moderators: phranque
-------
I have a site with multiple pages. I would like to 301 that domain with all the pages (using the 301 redirect / www.example.com/newpage.php) but I'm looking for any advice on such a move. Essentially I would have say, a 4 page website being redirected entirely to either www.example.com or to www.example.com/newpage.php. Will such a 301 be less effective? A total waste of value for the additional pages being 301? I don't have many incoming links on the additional pages, but of course there is content, images, etc. I'm just needing to resolve this 301 and keeping it as compact a move as possible. I really don't want 4 new pages on my new domain, and would just like to redirect the entire old domain to a single page. I would prefer to know though, if this is a really bad idea before doing it.
Secondly..
My site has been using this hta redirect:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.(html?¦php¦asp¦cfm)\ HTTP/
RewriteRule ^(.*)index\.(html?¦php¦asp¦cfm)$ [test.com...] [R=301,L]
RewriteCond %{HTTP_HOST} ^test.com [NC]
RewriteRule ^(.*)$ [test.com...] [L,R=301]
What I haven't seen in the many 301 threads, is when you want to 301 a domain to a new domain. I'm struggling with the way to redirect the index file.
301 redirect index.php [test.com...]
301 redirect /page.php [test.com...]
etc...
I've never been able to find a 301 tutorial or posting here that mentions the index file. Is what I've posted the way to move a domain to a new domain and keeping the same structure and value intact? I'm still not sure how the hta code that I first posted here, would affect how link are passed. Confused? I mean the index.php is redirected to "http://www.test.com/". There has been no acutal index.php because of my rewrite code. I'm sounding like a newbie, but that's okay. I'm just not sure how that rewrite code affects my plans for 301 the domain now.
Again, I appreciate any help. You folks are pretty much the only ones I would ever ask about for such advice. I trust you completely. I still say 301 redirects are like brain surgery of websites. Make a mistake, and things can go terribly wrong. Cheers!
RewriteRule ^ http://www.newsite.com/ [R=301,L] RedirectMatch 301 ^/ http://www.newsite.com/
RewriteCond %{HTTP_HOST} oldsite\.com [NC]
RewriteRule ^ http://www.newsite.com/ [R=301,L]
Making any other changes at the same time seems to raise a red flag on 'trust issues' with search engines. Realize that many MFA proprietors and scammers/spammers snap up expired domains and point all the expired domains' pages to one page on their main 'mother ship' site simply to capture the traffic intended for the expired domains and to take advantage of the hapless visitors to try to sell them some kind of enlargement pill or something...
So my recommendation is to 301 redirect each old page to an identical page on the new domain, and keep those 'old' pages through several search engine indexing cycles before changing anything else but the domain. Then change the 'old' pages or 301-redirect them to the new home page one at a time (again waiting through several search engine indexing cycles between each change). If you pretend that search engines are elderly aunts with weak hearts, easily-startled, and likely to cut you out of their will if upset, you won't be far off the mark. Having said that, you really should ask for more opinions in one of our SEO-related forums, since this is really a server technology forum, and not exactly full of SEOs...
The code for a page-to-page domain redirect is not much more complex than that posted above for redirecting all-to-one. To redirect each resource on the old domain to the same resource on the new domain, just use:
RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L] Redirect 301 / http://www.newsite.com/ As with the code above, you'll need to use the mod_rewrite rule and add the RewriteCond as previously-shown if the sites are co-hosted in the same filespace (same DocumentRoot).
Once all requests for the old domain are landing on your new domain, you can use the same domain and index page canonicalization rules as before. But again, if the sites are sharing filespace, you'll need to tweak those rules to check HTTP_HOST using RewriteConds to ensure that only the appropriate rules are invoked for each requested domain.
Jim
So far, with my other domains, I've been using:
Redirect 301 / [newsite.com...]
However, I was only using that only with my 1 page domains. It's these 3 or 4 page domains that I'm struggling with. I'm a bit confused about the above code. If I use that redirect, will this: www.oldsite.com/page1.php be redirected to www.newsite.com/page1.php? I assumed that that code would send all the pages (index + pages) all to the one specified url. For example, www.oldsite.com/page1.php would be redirected to www.oldsite.com etc. Am I correct? It's been very hard to really find an explanation anywhere as to how that would work exactly.
Just to clarify. This code:
RewriteRule ^(.*)$ [newsite.com...] [R=301,L]
I would first create the duplicate urls for all the pages to be moved. I would add the same page content. I would then add this code into my old site .hta file. At that point, the old urls would redirect to, for example, www.oldsite.com/page1.php would redirect to www.newsite.com/page1.php. Have I got this correct now?
Again, I certainly appreciate your detailed reply. It's been extremely helpful to me. I'm very close to lifting a big penalty issue I've had for 2 months now. I find this process like eating peas. I have to plug my nose! Oh well.
Redirect 301 / http://www.newsite.com/
RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]
IMO, one-page domains are not the way to success with today's search engines. They're also not a very good investment, considering that domains aren't free. By using multiple domains, you may be essentially 'competing with yourself' for top search listings.
So I'd suggest that you re-think your overall approach to building sites and doing SEO, rather than concentrating on coding at this point. You'd likely be much better off building one large site on a single domain to capture traffic for your desired keywords and phrases and to "build a brand" rather than fooling around with a bunch of 'one-page sites' -- The major search engines all agree that one-page sites do not give 'signals of quality' and therefore are not deemed very valuable by either visitors or search engines. Build a useful, informative site and you'll get more traffic and people will link to it voluntarily. And also, as search engines more closely approach the 'holy grail' of making SEO irrelevant, it will rise to the top of the SERPs based on those inbound links even without any attention to today's SEO considerations.
Add the 'old' pages/content to the new domain, then update any links that you control to point to that content on the new domain, then add the redirect code, then test thoroughly with a browser and an HTTP headers checker such as the "Live HTTP Headers" add-on for Firefox/Mozilla browsers to make sure your redirects work as expected, and that only one redirect occurs for any given client-requested URL.
Jim
So, it looks like this morning I will move my bigger site via:
RewriteRule ^(.*)$ [newsite.com...] [R=301,L]
The only real problem I have, it that my newsite index is something that I want to keep as is. I would assume the smartest thing to do, is to copy as much content from old site index to the newsite index. If that makes sense, I'm moving olddomain to an existing and ranked newdomain. From what I understand, to make this as smooth as possible, the new landing page should be very similar, if not exactly the same as the original url. In my case, I will need to make it as similar as possible.
Last question... I think!
Just to clarify, if I use:
Redirect 301 / [newsite.com...]
and my oldsite content is like this:
index.php
/page1.php
/page2.php
/page3.php
And if I only create newsite.com, and not newsite.com/page1.php, etc, then I'm essentially wasting the value in those additional pages? So if I did the above, I would be taking say, 4 pages, condensing them into 1, and having them land on newsite.com index page only?
You are saying that to use it properly, I need to do this:
Redirect 301 / [newsite.com...]
and create these pages:
newsite.com (index page)
newsite.com/page1.php
newsite.com/page2.php
newsite.com/page3.php
Sorry if I'm sounding painful on this! I really hope to finally make these essential moves today.
Just to clarify, if I use:Redirect 301 / [newsite.com...]
and my oldsite content is like this:
index.php
/page1.php
/page2.php
/page3.phpAnd if I only create newsite.com, and not newsite.com/page1.php, etc, then I'm essentially wasting the value in those additional pages? So if I did the above, I would be taking say, 4 pages, condensing them into 1, and having them land on newsite.com index page only?
If you want a 'special' redirect for oldsite/index.php, then you'll need two rules, one for /index.php and the 'catch-all' rule that's already in place. And in order to do this conditional redirection, you'll need to use either RewriteRule or RedirectMatch instead of Redirect. But I can't help with the additional rule without knowing where you'd want oldsite/index.php to redirect to on newsite.
Jim
This is what I entered into my .hta from before:
Redirect 301 /index.php [newsite.net...]
Redirect 301 /folder/page1.php [newsite.net...]
Redirect 301 /folder/page2.php [newsite.net...]
---
My confusion is how I'm to move this site to a new site with different folder names, structure and file names? If you type in: olddomain.com, you get to newsite.com which is great. But if you type in olddomain.com/index.php, you go to the old site, but an odd url with the root of my server!? Like this: "http://www.myserverroot/oldsite/". I think I've screwed this up. I would have thought the olddomain.com/index.php should end up at newsite.com but it doesn't. I can't use the: 301 redirect / [newsite.com...] because I'm changing structure and file names from what I understand.
I thought I had this figured out but I don't. Sorry! I'm trying to move the old site onto a new site, but the new site has different structure and file names. Again, the page content is similar and I pasted old content onto the landing pages of the new domain.
It seems like all the examples I find on the net explain how to move a old site via 301 to a new domain, but no examples for moving an old site to a pre existing site with different structure/file names, but very similar content. I realize why there aren't a lot of examples out there, because most people don't have duplicate type sites on different domains. Sadly I'm one of those people!
- "This assumes that the new site is on a different server, or that at least it is not hosted in the same filespace (with the same DocumentRoot) on the same server as the old site."
-- I'm a newb, so just to clarify. I have one server, with unlimited domains. All these domains are in the public_html folder, but under my one account. So, I'm confused. Does this mean that my other new domain is hosted in the same filespace with the same Documentroot? I'm just not sure what it is that I have to add to my .hta in this instance.
=========
To backtrack...
I have old site. I have new site that is ranking and is similar content to old site, but different folders and file names. I simply am trying to move the entire old site and place it onto the new site. I want to slot the 4 pages from old site onto the new site pages which have similar content. The issue for me is, the new site has different file names and structure. I understand how to move or 301 redirect an old folder/file name, but that doesn't deal with the index file. How do I incorporate the individual 301's with an index 301 in the same .hta? This is where things fall apart for me. When you type in: oldsite.com/index.php I'm wanting newsite.com/index.php. When you type in: oldsite.com/folder/oldpage.php I'm wanting newsite.com/newpage.php. I just can't understand how to deal with moving individual pages and the index all within the same .hta file.
I thought I had this correct, but looking at my old .htaccess, I am having this issue:
oldsite.com --> newsite.com
oldsite.com/folder/oldpage.php --> newsite.com/newpage.php
Great those were fine. However...
oldsite.com/index.php --> [myserveraccountmaindomain.com...]
That last situation here is very confusing to me. Obviously I'm not 301 to newsite.com for some reason. Is that my root directory that oldsite.com/index.php is being redirected to?
So it's possible, with that last situation, that my 301's in place for the past couple weeks have been ruining my sites value. I don't know how the bots deal with the index or if they are getting confused by what I've done.
====
I'm humbled by this process. I feel like I'm messing up my 301's. Sorry to have repeated myself, but it's hard for me to explain the situation clearly. It's understandable if you feel I'm beyond help. Thanks again.
Since you've got only a few pages on the old domain, you can write one rule for each of those old pages' URLs if necessary, and redirect each old URL to the new URL. Or you can write one catch-all rule, but precede it with one or more more-specific rules if needed.
So if necessary, simply use one
RewriteRule ^<[i]old-URL-path[/i]>$ http://new-domain.com/<[i]new-url-path[/i]> [R=301,L]" If your old index page is linked-to as "/" then the rule pattern will be just "^$". If your old index page is linked to as "index.php", then type "index\.php" as the pattern (the period should be escaped). And if your old index page is linked-to as both, then the pattern would be "^(index\.php)?$". Or you could even use two rules if you wanted, one for "/" and one for "/index.php", and just redirect them both to the new URL.
For best results, test your code, identify all cases that work correctly, and all cases which do not. Then post your current code and *specific* questions along with information about each problematic test case:
What URL did you type/test?
What were your results?
What did you expect?
Compare and contrast the expected versus actual results.
Include any information found in your server error log pertaining to the problem. If error log data is present, correlate these error log entries with any useful information from your server access log, and note any browser error messages as well.
A note: Some members have noticed and commented privately on the fact that I don't use indefinite words like "it" as frequently as is normal in conversational writing, but instead will often repeat a specific noun-phrase -- even within a single sentence. There are two reasons for this, the first being that we have an international readership, and some members' languages may have different rules about assigning indefinite articles, and the second reason is that very often, we'll have two or more factors involved in a process, and if an effort isn't made to be very specific, then confusion and wasted effort will often result. So the bottom line is, feel free to be specific, be verbose, and to make sure that what you write cannot be mis-interpreted in any way. Posting too much information is usually better than not posting enough, as long as everything that is posted is relevant to a specific question. :)
Jim
Something interesting....
In all my attempts at this, I was not using at the top of my .htaccess:
Options +FollowSymlinks
RewriteEngine on
So.... I tried adding it and removing it. The point is, my redirects were not working without those 2 lines. I'm a dork so I don't know why. Perhaps it was understood that I would have included those at the top of my .htaccess, but I wasn't during my attempts following my initial post here.
So, the bottom line is, it seems to be working, as planned. The fog in my brain is starting to clear. A few more tests, then I will move forward on all my needed redirects. Cheers! (I will post back with another update)
I've posted this three or more times in the past week, but I'd might as well post it again, so as to "spread the word" :
To prevent unexpected results of many kinds, RewriteRules should be ordered with all external redirects first, in order from most-specific patterns and conditions to least-specific, followed by internal rewrites, again in order from most-specific to least specific.
Jim