Forum Moderators: phranque

Message Too Old, No Replies

301 domain with multiple pages to new domain single page only. Bad?

         

MrSavage

8:44 pm on Oct 31, 2009 (gmt 0)

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



I've had some real problems searching and finding a solution or advice dealing with my 301 situation. I would greatly appreciate any insight. I am still dealing with a 2 month Google penalty.

-------

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!

jdMorgan

2:28 am on Nov 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are redirecting the whole old site to a single page on the new site, then the index page needs no special treatment. You'd just use:

RewriteRule ^ http://www.newsite.com/ [R=301,L]

-or-
 RedirectMatch 301 ^/ http://www.newsite.com/

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. If it is, then you can't use the mod_alias RedirecMatch directive, you'll have to use mod_rewrite, and change the rule above to

RewriteCond %{HTTP_HOST} oldsite\.com [NC]
RewriteRule ^ http://www.newsite.com/ [R=301,L]

As for the efficacy of doing this --redirecting all old pages to one new page-- it's not really a great idea, since the one new page isn't likely to be as 'valuable' for the targeted search terms as the four old pages were. If you're not worried about search engine ranking, but are more concerned with simply recovering the traffic from old links and bookmarks, you can do this. But the general recommendation when changing domains is to keep absolutely everything else -- the page URL-paths and the pages' content-- the same until the search engines have time to 'digest' the domain change.

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] 

-or-
 Redirect 301 / http://www.newsite.com/ 

Note that we now capture the URL-path in the RewriteRule pattern and back-reference it in the substitution URL as $1, and that the "RedirectMatch" directive has changed to a "Redirect" directive with a few minor syntax adjustments. If this isn't clear, then look up each of these directives in the Apache mod_rewrite and mod_alias module documentation.

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

MrSavage

3:30 pm on Nov 1, 2009 (gmt 0)

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



Thanks Jim very much for your fantastic reply! It has me rethinking my original plans.

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.

jdMorgan

3:56 pm on Nov 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



These directives are equivalent, and both redirect all resources (pages, images, etc.) on 'this' domain to the corresponding resources on 'newsite;' only the domain changes, and the URL-paths remain unchanged. Review and understand the Apache documentation unless you wish to risk your sites; these are server configuration directives, and server config is not to be trifled with...

Redirect 301 / http://www.newsite.com/
RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]

> However, I was only using that only with my 1 page domains.

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

MrSavage

4:34 pm on Nov 1, 2009 (gmt 0)

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



Essentially, I'm backtracking on my one page domains. I'm doing the right thing, and that is to send these to my main site via 301 redirects. Ultimately, it is the amount of site that I launched, which led to my penalty. It was recommended to me that I should redirect these domains to one main site. So yes, I 100% agree with your comments about 1 page domains. It's a hard lesson to learn, but I've learned it the hard way you could say.

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.

jdMorgan

4:49 pm on Nov 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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?


If you use that directive and do not create the pages, then they will all return a 404-Not Found when requested from oldsite and redirected to newsite, unless newsite already has pages at those URLs.

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

MrSavage

10:02 pm on Nov 1, 2009 (gmt 0)

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



I've look over a previous 3 page site that I tried to 301 to an existing site, same type of content, but not a duplicate.

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!

g1smd

10:25 pm on Nov 1, 2009 (gmt 0)

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



Use RewriteRule instead of Redirect and you'll find the process a whole lot easier.

You can test for what was requested and specify the new full target URL. Use the [R=301,L] flags on every rule.

MrSavage

6:55 pm on Nov 2, 2009 (gmt 0)

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



Hello again. I'm deep in the muck. Obviously I'm just not smart enough to fully understand how to do this.

- "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.

jdMorgan

7:51 pm on Nov 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems that you think this is more difficult than it is. Maybe I don't understand the 'conflict' or 'problem' you perceive with redirecting your index page...

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]" 

for each old page's URL and just type the actual page URL-paths in there (the "<URL-path>" is "everything except protocol, the domain name, and the initial slash," and everything else in this example rule is literal).

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

MrSavage

10:06 pm on Nov 2, 2009 (gmt 0)

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



Terrific! You saying "Or you can write one catch-all rule, but precede it with one or more more-specific rules if needed." was extremely helpful to me. I dealt with the index file last in my .htaccess and did the individual page redirect first.

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)

jdMorgan

10:41 pm on Nov 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Speaking only for myself, I saw that you had those two 'required setup' lines in your original post. After that, any discussion was of rules and not of setup. The Apache mod_rewrite documentation makes clear what the function of the RewriteEngine directive is, and notes that the FollowSymLinks or SymLinksIfOwnerMatch option is required to enable the entire module.

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