View Full Version : Using base href as a substitute for 301 re-direct?
JohnC
14-04-2006, 16:23/04:23PM
I had a conversation today with an associate. He mentioned to me that a Google Engineer told him that when using domain variations such as mywidgets.com and mywidgets.net a base href tag on the page would satisfy them and he would not have duplicate content issues as long as he did not promote more than one domain.
This was the first I had heard of this use of base href. I of course promoted the idea of the 301 redirect, but he is still unsure. He had also been to the SEW show a couple of years ago and none of the SEOs he spoke to mentioned using 301 for domain variations.
I was hoping to get some discussion on this use of base href. I will be showing him this thread so he can follow along. :)
Blue
14-04-2006, 16:34/04:34PM
I know the inimitable G1 has mentioned this a number of times in here (http://www.ihelpyou.com/forums/search.php?s=&action=showresults&searchid=554257&sortby=lastpost&sortorder=descending). I'm sure he'll be in to shed some more light on this discussion.
g1smd
14-04-2006, 18:41/06:41PM
Yes. I have been promoting this method for a year or two.....
If all your internal links include the full domain name, or all your internal links simply start with a / and count from the root, then you can use the <base> tag to signal the true domain that you want the page to be seen to be belonging to.
So, this can fix the www vs. non-www problem if all the pages have a base tag that includes the www in it, and it can also help you if the same pages are available at both .com and .org and all the pages have a .com base tag on them, for example.
This also provides you with some good protection against any malicious 302 redirects pointing at your site.
In Google search results see that in the cache of your pages Google adds the <base> tag in their header to allow all of the links out from those cached pages to still function. If you add the <base> tag yourself, then they don't have to figure it out for you.
JohnC
14-04-2006, 18:57/06:57PM
I understand how this works for internal linking ...
But how does it work when you have base href on domain A pointing to domian B.
More detailed example.
SiteA.com and SiteB.net are mirrors (variation on a domain, one is the .net version, both have identical content)
SiteB.net uses the base href and states the base is SiteA.com. Does this prevent duplicate content issues? Do the engines recongnize this to be the same as a 301 redirect? What if there are dozens of domain variations?
Trying to get a handle and brain storming some possible senerios.
g1smd
14-04-2006, 19:10/07:10PM
Once the surfer hits site B, all "internal" links take you to site A and all further browsing takes place wholly on site A. By using the <base> tag, all pages are saying that they are on site A even when they aren't.
If you can't browse from page to page on Site B, then it can't be indexed.
Here's the kicker.
If you were to have site A setup as a 302 redirect to site B, host all the pages at site B, and all those pages have a base tag saying they were really located at site A, and all internal links pointing at site A URLs, then Google would list every page of the site as being at site A and would not feature any site B URLs in their index at all.
ihelpyou
14-04-2006, 20:16/08:16PM
LOL
301 redirect is the way to go.
Just tell the naive out there to stop promoting two domains for one website and they don't have anything to worry about.
I just don't trust the base href thing by itself.
Connie
14-04-2006, 21:00/09:00PM
If you were to have site A setup as a 302 redirect to site B, host all the pages at site B, and all those pages have a base tag saying they were really located at site A, and all internal links pointing at site A URLs,
If site A has 302 redirects then how is any SE going to see what is on a page. They should be immediately redirected to the new URL.
In regard to redirects if it is a permanent move then it should be a 301.
g1smd
14-04-2006, 21:07/09:07PM
That is exactly how a 302 redirect should work.
The starting URL in the redirection chain is the one that should be listed, and the real location of where the pages "are" should not be listed.
It works even better when the pages acually confirm in their base tag that the URL that has a 302 redirect is the one to be listed.
g1smd
14-04-2006, 21:43/09:43PM
OK Let's clear up the confusion with some examples.
You own both www.domain.com and www.domain.org. You point both domains at one server and host the content there, and try to get all pages of the site listed under both domains, but instead you wind up with a big fat Duplicate Content Penalty, as both URLs return "200 OK" for every page of both sites.
So, you could fix this in one of several ways:
- If your host allows 301 redirects then you redirect all requests for pages at www.domain.org to the www.domain.com domain. Eventually only URLs at www.domain.com are listed in search engines. No pages at www.domain.org are listed in search results because those URLs always issue a Moved Permanently directive.
- If your host does not allow redirects then you add a <base href="http://www.domain.com"> tag to the head of every page of the site. When you are looking at www.domain.org/aboutus.html the navigation link on that page points to /aboutus.html but when combined with the base tag it clearly points to the www.domain.com/aboutus.html page. When you are looking at www.domain.com/aboutus.html the navigation link on the page points to /aboutus.html and when combined with the base tag points to the www.domain.com/aboutus.html page (i.e. itself). All of the other navigation links on all of the other pages of the site also point only to www.domain.com pages and so it doesn't take search engines long to realise that the main site to list is www.domain.com and so they list that, and delist the other one.
- If your host is clueless and only allows a 302 redirect, then you can still set things up to only get one URL listed. The 302 redirect says "Moved Temporary", so it is the starting point URL that would listed as belonging to the target page content. So, any access to pages at www.domain.com are redirected to the same page over at www.domain.org for example, and it is the "page" at www.domain.com that gets listed in the SERPs (even though there is no physical content at that URL). This does cause duplicate content issues because the URL with the content on it at www.domain.org is still accessible and it issues its own "200 OK" response. The fix is for that page at www.domain.org to have a <base href="http://www.domain.com/"> tag on it so that all outgoing links point to www.domain.com URLs. Any surfer or bot navigating the site would be looking at physical pages located at www.domain.org and their browser URL bar would also show www.domain.org but when they click any internal link they would be taken to the www.domain.com URL, and then go through a 302 redirect to get to the correct page on the www.domain.org server. This would occur for every page of the site. Eventually the search engines would only list www.domain.com pages in the SERPs (even though there is no physical page at that "location"), and that is the correct action for a 302 redirect.
ihelpyou
14-04-2006, 22:01/10:01PM
I've got a headache.
I'd say if you are at a host who only allows a 302, simply get another host. Doing anything but a 301 is just too confusing. Much easier to simply change hosts to one who has a clue.
Connie
14-04-2006, 23:31/11:31PM
If a host allows a 302 why couldn't you do a 301? Either requires .htaccess right.
If a host allows .htaccess and mod_rewrite how could the host limit that to the use of a 302 only? Secondly why would they?
I use both on my site. Which ever one I use makes no difference for on page content, because as soon as the URL is requested, a browser or spider is taken to the new page.
I usually delete the original page. Using a 301 or 302 the original page no longer exist for all practical purposes.
I would love to see an example of a 301 or 302 where I could actually look at the original page and the source code rather than being redirected to the new page.
It's registers that allow domain forwarding that usually allow a 302 only. That has nothing to do with hosting. Personally I would not forward a domain from a register.
g1smd
15-04-2006, 21:45/09:45PM
You can look at the source code for a 301 or a 302 redirect.
You use WebBug for that. It will show something like:
HTTP/1.1 301 Moved Permanently
Date: Sun, 16 Apr 2006 00:44:47 GMT
Server: Apache/1.3.33 (Unix)
Location: http://www.that.domain.com/
Connection: close
Content-Type: text/html; charset=iso-8859-1
There is no HTML returned. There is no page there to be returned. There is only the information in the HTTP header.
Connie
15-04-2006, 22:10/10:10PM
I know what the source code looks like using webbug or any other header checker. I already said I use both 301s and 302s.
I use a 301 when I remove (or take products) off my site that I reasonably do not think will ever be included again.
I use a 302 if I think the removal is temporary.
I have read several post you have made in regard to base href but it seems to me it is always in relation to a 302 redirect. I'm always confused.
If the base href is important shouldn't it be just as important for a 301 as well as a 302?
I can only assume that since the page redirecting no longer exist the the base href needs to be placed on the pages of the site that is being redirected to.
I would like to see a host who only allows 302 redirects while they allow .htaccess and mod_rewrite.
I really do not mean to be argumentative, but I'm trying to understand some things that you have not made clear to me.
g1smd
16-04-2006, 06:39/06:39AM
I tried to make it very clear. I'll use some different words and try again. :D
Any URL that returns a HTTP status of "200 OK" and a page of HTML (or PDF, or text, etc) content will get indexed. If multiple URLs containing the same content all return 200 OK then you have "Duplicate Content".
Any URL that returns a "301 Moved" will not get indexed. There is no "page" there to be indexed. However, if the place that you are redirected to returns a "200 OK" then it will be indexed. This is what you want. Multiple URLs that lead to content, only ONE of which is indexed.
Any URL that returns a "302 Moved" status will have that URL indexed, but using the content of where the redirect points to.
However, since the place that the redirect points to also returns a "200 OK", then it too will be indexed, and you have a "Duplicate Content" problem again.
If on those pages you place a <base> tag, and that <base> tag contains the domain name of the domain that issues the redirect (not the domain name of where it really is), then it is the redirecting URL that will be the only one that will be indexed. By adding the <base> tag you have effectively "hidden" the target URL from view, and solved the duplicate content problem.
You do not need to have the <base> tag on the pages when you do a 301 redirect, because for a 301 redirect it is only the target page that would be indexed anyway. There is no contradiction.
However, you can add the <base> tag to the pages, if you want to, to protect you from other people who point a 302 redirect at your site trying to get your content indexed under their URLs (the so-called "302 redirect URL hijacking problem"). In this case the domain in the <base> tag is the same as the domain that the site is actually located at.
You can also use a <base> tag when you are not able to set up any sort of redirect at all (either from non-www to www, or from .co.uk to .com for example). In this case the <base> tag is used to clarify the "true" domain for the site, and to canonicalise the URLs of all of the outgoing links from the page. You choose which one of your domains to put in the <base> tag on every page of the site, and then the whole site will be indexed only under that one domain.
ihelpyou
16-04-2006, 08:41/08:41AM
Yep. Always use a 301 redirect. No need for anything else that way. If your host doesn't allow it, or they are too stupid, get another host.
JohnC
16-04-2006, 13:11/01:11PM
Originally posted by g1smd
You can also use a <base> tag when you are not able to set up any sort of redirect at all (either from non-www to www, or from .co.uk to .com for example). In this case the <base> tag is used to clarify the "true" domain for the site, and to canonicalise the URLs of all of the outgoing links from the page. You choose which one of your domains to put in the <base> tag on every page of the site, and then the whole site will be indexed only under that one domain. I understand the usage in conjunction with a 302 Redirect the above explaination makes that very clear. Thanks G1.
However, the usage without the 302 I have problems with. I am looking at a site right now (sorry cant publicly disclose URL atm) which has been using the <base> for a very long time, it currently has both the www and non-www indexed seperatly. It also has a number of domain variations all using <base> pointing to the main domain and every site is penalized including the main. I just dont buy the <base> by itself. Yet.
G1 send me a PM and I'll show you the domains, maybe something is configured wrong.
g1smd
16-04-2006, 17:35/05:35PM
My guess is that they are either actively promoting more than one domain, and/or the domain in the internal linking is not consistent throughout all of the pages.
I would run Xenu LinkSleuth and see what you get.
JohnC
16-04-2006, 19:02/07:02PM
Originally posted by g1smd
My guess is that they are either actively promoting more than one domain, and/or the domain in the internal linking is not consistent throughout all of the pages.None of the domains have any internal pages. All of the domains are supposed to redirect to the primary which is an affiliate feeder page to capture revenue from type in traffic.
None of the domains are promoted at all, though a few are very common words and get a very good amount of type in traffic.
JohnC
17-04-2006, 12:41/12:41PM
bump .. (might have gotten lost over Easter .. hehe)
ihelpyou
17-04-2006, 16:08/04:08PM
What's the question again?
This seems to be someone who owns domains and uses them to capture typo traffic to make money off adsense. Why are you trying to help them in the first place? These type pages are what I like to call...... useless to the internet. :)
JohnC
17-04-2006, 16:19/04:19PM
No Adsense at all Doug, it's someone who gets 10,000's of type-ins and I am trying to help him do it right. While some domains are typos most are not. .. :)
In the end there will be one site and a bunch of domains pointing to it the right way. Cant blame the man for wanting to make some money off of his VERY good domains. He doesnt want to sell them, and building out sites is not his business or does he want a bunch of sites. So it falls to me to "fix". :)
ihelpyou
17-04-2006, 16:37/04:37PM
Doing the 301 is the "only" good way to do it. NO hassles that way. Point them all to ONE domain, and then later on build ONE website on that domain. If you do anything else but a 301, just means more problems down the road.
g1smd
17-04-2006, 16:45/04:45PM
Having taken a look, the current scheme is looking more like "doorways" than anything else.
The problem all comes back to trying to "earn a buck for passing the user on to the real site, after they typed in the wrong domain name" (by adding a referrer ID as they are passed along).
I can't blame anyone for wanting to do that, but Google sees it differently. They want to list only the real site, and that is the place where all the content really is.
JohnC
17-04-2006, 16:54/04:54PM
Thats why I want to go 301 .. that way I am sure the extra domains are not indexed and there is no chance the enignes will "see" anything but the correct domain.
He was told that <base href> will do this for him and I just cant see it. From my perspective, the only solution is 301.
g1smd
17-04-2006, 17:04/05:04PM
If all of the domains point at one server, and all of the accesses allow you to view any page of the site under any of the domains (and it is a multiple page site), and all pages return "200 OK" irrespective of which domain is being accessed, and you are unable to set up a 301 redirect, then the <base> tag can help.
It has to be a multiple page site so that when the bot traverses all of the pages on all of the different "versions" of the site it is contstantly being channeled back to one domain name all the time. Then it could work.
It can never work for a single page site or for a site that doesn't link to multiple internal pages, nor back to the root index page. In that case there are no links to be canonicalised.
JohnC
17-04-2006, 17:11/05:11PM
OK .. Thank you for the help G1 both here and in PMs..
So in the context of the original question which was about domain name variations (which normaly are one or no-page sites) the <base href> would not work according to the above and the 301 is what is needed.
Now if you are changing domains on an exsiting site, then you could put the <base href> on the old domian pointing to he new one and it would work like a 301 ...
Do I sound like I have it ? ... :)
ihelpyou
17-04-2006, 17:23/05:23PM
Now if you are changing domains on an exsiting site, then you could put the <base href> on the old domian pointing to he new one and it would work like a 301
No. You want the old backlinks to also refer to the new domain. Only a 301 will do that as far as I know. I used a 301 moving these forums from the old domain of MANY years to the new domain just 4 months ago, and new url's have been picked up almost instantly. A base href would "not" have done that at all.
It seems to me he wants to use one page sites to make money. The problem is that the search engines don't like that at all. He runs the BIG risk of ALL those domains being banned, including the one domain he may build a real website on one day.
This is exactly like some blackhat spammers who advertise to clients they will buy domains and put up a one page "doorway" that then refers visitors to the main client website. They do this so as to charge the client on a per click basis. It's pure spam. This is exactly what your friend is doing. It's bad stuff even if he doesn't realize it.
JohnC
17-04-2006, 17:29/05:29PM
So now I am back to not seeing any use for <base href> in this context ... lol ... I have always used 301 and I hope this thread will help to convince my associate that this is the way to go ...
He does have issues Doug, thats what I am working to correct. I know he was not doing anything intentional to try and decieve the engines, as we know opinions in this industry vary and at one time he got an opinion that is probably causing him these problems now. It will take some time, but it will get worked out ... the right way. :)
Connie
17-04-2006, 18:48/06:48PM
G1 I have never seen a 302 return a header response of 200. If that's what your are talking about I agree that would be a problem.
John I think Doug is right. You have to use a 301. A 302 if it is working properly tells the SEs that the move is temporary, and the original page will be back.
Personally I would not even redirect an alternate spelling with a 301. I have had problems on my site doing that.
So I have a site for each alternate spelling that has a custom 404 error page. SEs are disallowed from the the sites and the custom 404 error page.
Yes G1 those alternate spelling were redirected with a 301. I have raised this issue several times.
The problem occurred before Matt Cutts admitted that Google was having problems with 301.
But personally I'm still afraid to redirect those alternate spellings to the correct site.
I have to also question how many searchers type in the domain name they are searching for.
I know from my logs that I get referrals from the SEs where the Company name was typed in but they are few and far between.
g1smd
17-04-2006, 19:05/07:05PM
A 302 redirect returns 302, and the URL of where to go to get the actual content.
A "real" page returns 200 when you get there, whether you got there through the redirect, or went directly to the URL of the "real" page.
If multiple URLs point at one piece of content the best way is to use a 301 redirect on all but one of the URLs, but if you cannot do that the <base> tag can help fix it, as described above.
gnew
01-05-2006, 23:36/11:36PM
I really disagree with you on the 301 thing. So many users I watch have gotten into the
habit of just typing the domain.com without the www . Watch a few of
them, my wife does it / others do it (most don't have add www. checked in
their browsers) 301's are just NOT pretty and the search engines don't
care about multiple domains IF
1) One markets ONLY ONE of the multiple domains to them and
2) IF one has a base href on each page that is consistent with
the one
"marketed" .
In my possibly badly informed opinion, content is still king.
Th SEO's who have complained that Google has penalized them probably
did NOT have base href's on their pages: hey it's been years since we
needed them. Are they certain of their test results? I.E. did they
absolutely have base hrefs and they were still penalized? I find this
hard to believe because a computer can NOT see beyond a base href. It is
only logical that the site's base href should and would determine what a
search engine robot can catalog on interior and also exterior pages.
Anyhow, I have a client www.islandreal.com who wants a 301 AND realizes that
people just type in domain.com without www so they are VERY confused on
this issue. (Someone has told them that while their site has NEVER
been penalized by Google, since there is no 301 re-direct for the non
www site, they will be at some point. I have tried to explain this
to them, but it seems they now trust this SEO more than me :-( L
ihelpyou
02-05-2006, 00:04/12:04AM
Welcome! :hi:
Anyhow, I have a client www.islandreal.com who wants a 301 AND realizes that people just type in domain.com without www so they are VERY confused on this issue. (Someone has told them that while their site has NEVER been penalized by Google, since there is no 301 re-direct for the non www site, they will be at some point. I have tried to explain this
to them, but it seems they now trust this SEO more than me .
If you don't use a 301 or 302 or a base href, there is "no" penalty at alll. The se's simply pick one of them to include and drop the other. Either that, or they leave "both" ways in the index which hurts the site as well.
This has nothing to do with how someone types the domain in the address bar. It's only because the se's see both ways as being "two" different domains. "Other" sites can link to your site either way. That's why it's very possible that one site will have both ways in the indexes. The best way to solve the problem of the possibility of the se's indexing both the www and without is to use a 301 redirect. That ensures the se's will 'not' index both ways. It's always best to use the www way as that is how "most" other sites will link to you. All major directories have human editors and that is how they will list your site in their directories as well.
Yeah sure, using a base href tag is fine and dandy, but if you don't use in conjunction with a 301, all problems outlined in this thread will go along with things.
Always use a 301 to be safe. There is "no" penalty however.
ihelpyou
02-05-2006, 00:06/12:06AM
Also; I'm very sure the se's are trying to handle this exact issue. Soon they will know that a site with both www and without is the same site. Once they get it ironed out, none of any of this will matter.
ihelpyou
02-05-2006, 00:08/12:08AM
301's are just NOT pretty
What is not pretty? A browser does not even see the redirect when they type in the url, so this has nothing to do with pretty or not pretty. :) 301's are done server side.
Quadrille
02-05-2006, 05:08/05:08AM
Originally posted by gnew
I really disagree with you on the 301 thing. So many users I watch have gotten into the habit of just typing the domain.com without the www . Watch a few of them, my wife does it / others do it That's no problem; they'll still get where they want to be.
Just think of a 301 as typing WWW. for them.
Sure, they are a chore to set up, but they do the job, far better than any other method, and without the SEO (and other) risks.
I have heard of one or two problems - ask Connie - but for the overwhelming majority, they are smooth as silk, and invisible to the visitor.
WWW or not is a matter of choice; it just happens that the majority have stuck with the WWW, is all.
What is vital is to choose one and stick with it, especially for internal links.
g1smd
02-05-2006, 07:01/07:01AM
>> So many users I watch have gotten into the habit of just typing the domain.com without the www. <<
Yeah. I type google.com in my browser too. You try it and then watch the URL bar to see what happens.
I am already aware of a site with more than 80 000 pages that is fully indexed as non-www in Yahoo and fully indexed as www in Google. There is no redirect in place, nor a <base> tag. That site is probably heading for a lot of problems...
JohnC
02-05-2006, 09:56/09:56AM
Welcome to IHY GNew .. :hi:
ArmenT
04-05-2006, 01:56/01:56AM
Originally posted by ihelpyou
What is not pretty? A browser does not even see the redirect when they type in the url, so this has nothing to do with pretty or not pretty. :) 301's are done server side.
Completely incorrect. You're confusing external vs. internal redirects.
ihelpyou
04-05-2006, 09:34/09:34AM
Please expand on that comment. :)
What's not correct; a 301 is pretty or not?
IMO if you click on a link, and that url is being redirected to another url using a 301, unless you are actually looking for this in the address bar, it goes almost unnoticed by the average surfer. That's what I mean by "pretty" or not. :)
But please explain what you mean.
JohnC
04-05-2006, 09:51/09:51AM
Originally posted by ArmenT
Completely incorrect. You're confusing external vs. internal redirects. I think you are refering to Dougs statement about 301's being done server side. 301 can be done both server side and client side. The best way to do them is server side (via .htaccess on Apache and directly in IIS on Windows), however in some cases client side is required and can be done using a number of coding languages.
As far as "confusing external vs. internal", you have me confused there. Are you speaking about the re-directs or the links or something else? Can you be a bit more specific?
gnew
04-05-2006, 11:09/11:09AM
Sorry Guys DROP the discussion about 301`s not being pretty. I had not put one on my server yet and though it would look like a 404 or something. MY MISTAKE . Very sorry to set off such a discussion. I'll try to know what I am talking about before I comment..:o:
The Question is still that I think a base href is a better practice. No one has truely convinced me otherwise. Matt Cutt has not yet replied to this post.
http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
ihelpyou
04-05-2006, 12:29/12:29PM
Exactly why would a simple base href be better?
All se's can pick up a domain from anywhere, and index it. They can even get domains from registrars and index them. If all these domains are pointing to "one" domain/site, but they all get indexed, then what? A base href does 'not' solve that problem at all. ONLY a 301 can solve that problem. Read this thread carefully. I don't get why you need convincing at all. :)
What is so tough about implementing a 301 anyway?
g1smd
04-05-2006, 16:20/04:20PM
>> A browser does not even see the redirect when they type in the url, so this has nothing to do with pretty or not pretty. 301's are done server side. <<
>> Completely incorrect. You're confusing external vs. internal redirects. <<
People are arguing about the wrong bit of "incorrect".
The browser DOES see the redirect. The server issues it to the browser.
- Browser asks for "domain.com/some.page.html".
- Server responds "301 Moved - Go to www.domain.com/some.page.html instead".
- Browser asks for "www.domain.com/some.page.html".
- Server responds with "200 OK" and the page of HTML and content.
ihelpyou
04-05-2006, 16:45/04:45PM
Of course, The server does the redirect.
By "browser", I meant the actual user. ... armen was referring to the software (browser), and I was not.
gnew was referring to his clients and if the 301 was pretty or not. That's why I answered the way I did.
So sorry I am using the wrong words. But let's not be confusing; 301 are done at the server level. The browser,... meaning what you see when you look at the address bar, will not show the redirect to the "user".
I think we all need to be much more specific when we give answers, etc.
JohnC
04-05-2006, 16:54/04:54PM
hehe .. and I was referring to implementation, it can be done at the server software level or the page code level (also on the server) .. :)
Sorry if I added to the confusion. I'll try to be clearer.
ihelpyou
04-05-2006, 17:13/05:13PM
lol This kind of stuff is confusing enough as it is. I think every member in this thread could have been much more specific in what they were writing. I know I am confused by quite a few posts in here, and know I was not specific enough either, so I know people reading all of this are certainly confused. :)
g1smd
04-05-2006, 18:33/06:33PM
What was the question again?
:D :D :D :D :D :D :D
gnew
04-05-2006, 21:37/09:37PM
What is the meaning of life ?
Quadrille
04-05-2006, 22:12/10:12PM
42
Connie
04-05-2006, 23:00/11:00PM
Originally posted by Quadrille
42
42 or 62? :cheers:
ArmenT
04-05-2006, 23:01/11:01PM
Originally posted by ihelpyou
Please expand on that comment. :)
What's not correct; a 301 is pretty or not?
IMO if you click on a link, and that url is being redirected to another url using a 301, unless you are actually looking for this in the address bar, it goes almost unnoticed by the average surfer. That's what I mean by "pretty" or not. :)
But please explain what you mean.
Gah, that's what I get for quoting too much in my reply. My apologies.
I really meant the part about whether the browser sees the redirect or not. G1smd did a good job of explaining it.
To expound the difference between external and internal redirects -- In an external redirect, a status code of 301 or 302 is returned back by the server to the browser along with the new location. The browser then goes to the new location. Thus the browser DOES see the redirect, if it is an external redirect. So whenever you're talking status codes 301 or 302, you are talking about an external redirect. A typical use of this would be to redirect non www to a www domain. By the way, the address bar does change with an external redirect. Proof: Type http://ihelpyou.com/forums/ in your browser's address bar and watch the www get added in front.
An internal redirect on the other hand happens inside your webserver software. The user/browser don't see this redirect at all and are not even aware that a redirect took place. A typical use of this would be to make search engine friendly URLs. Say the webserver is running apache and the user request www.mydomain.com/fruits/apples.html
There may be a mod_rewrite rule in place that tells apache to treat it as though the user really typed:
www.mydomain.com/showdetails.php?cat=fruit&subcat=apples
As far as the user and browser are concerned, neither of them see the redirect at all. The redirecting happens inside the webserver and apache then runs showdetails.php which serves up the actual page. As far as the user is concerned, there really was a page at www.mydomain.com/fruits/apples.html and they don't know that it was internally redirected to a dynamic page.
Hope this all makes sense :)
WebSavvy
05-05-2006, 01:12/01:12AM
Hope this all makes sense :)
Yep. It does. :) (thanks!)
BTW Doug ... I wasn't confused by any of this. :D
I've done so many 301s and mod_rewrite URLs I even dream them in my sleep (and I'm not kidding!). Pathetic isn't it?
We're moving massive amounts of URLs due to heavy restructuring and I've just spent the past 8 days writing 301s for more than 4000 pages on the site.
Maybe I need a break?
hmmm ... the other question was "What's the meaning of Life?"
I'll take a stab at that:
* To learn to be humble.
* To learn to tolerate others and accept their differences.
* To try and overcome the human condition.
* To act in a way that is moral.
* To learn to forgive.
* To understand.
* To help whenever possible and do so without expecting anything in return.
My personal note, I try to create as much good karma and positive chi as I can. Negative energy begets more negative energy and it's all counterproductive.
JohnC
05-05-2006, 03:23/03:23AM
The original question was based around using Base Href as a substitute for pointing parked domains to a single live domain.
This thread did take a few off ramps from that original idea, so I tried to take everthing I could from here and apply it to the question. I also wanted to ad some specific info about how both Base Href and 301s work. It turned out to be VERY long, so I re-wrote it and turned it into an article called 301 Re-direct vs. Base Href Face Off (http://www.appliedseo.com/archives/301-redirect-vs-base-href-face-off/) on my blog.
As for the meaning of life ... Definatly "42"
g1smd
05-05-2006, 20:36/08:36PM
What you call an "external redirect" I tend to just call a "redirect".
What you call an "internal redirect" I usually refer to as a "rewrite".
But yes, sometimes these technical things need a few extra words for clarity...
ArmenT
09-05-2006, 12:40/12:40PM
Originally posted by JohnC
The original question was based around using Base Href as a substitute for pointing parked domains to a single live domain.
This thread did take a few off ramps from that original idea, so I tried to take everthing I could from here and apply it to the question. I also wanted to ad some specific info about how both Base Href and 301s work. It turned out to be VERY long, so I re-wrote it and turned it into an article called 301 Re-direct vs. Base Href Face Off (http://www.appliedseo.com/archives/301-redirect-vs-base-href-face-off/) on my blog.
As for the meaning of life ... Definatly "42"
<nitpick>
Off the bat, I spotted a couple of small errors in your article:
* Your very first base href example (where you explain what it is used for) is incorrect. You just put the base path, not the path to the document:
<base href="http://www.mydomain.com/path1/path2/">
<img src="images/test.gif">
* Status code 301 has existed for a very long time. http://www.w3.org/Protocols/HTTP/HTRESP.html dates to 1992 (when the original HTTP spec was written) and mentions it. You mention that it came out in 1999 with HTTP/1.1, which is incorrect.
* It is not necessary to put Options +FollowSymlinks in the redirect rules. It does something completely unrelated to redirecting.
* "You can also do Mod-Rewrite on windows based servers using ISAPI." ISAPI is the Microsoft protocol specification for writing a DLL (Dynamic Link Library) for IIS. What you should say is ""You can also do Mod-Rewrite on windows based servers using a third party DLL."
* Your PHP and ASP code are not equivalent. In fact, your ASP code could potentially put a server in an infinite loop! Would probably be useful to mention that this could be put in a 404 handler too.
</nitpick>
Good article though
WebSavvy
09-05-2006, 13:06/01:06PM
I haven't read the article yet (still haven't had a spare moment, sorry John).
Touching on what ArmenT stated about:
+FollowSymlinks
He's correct. It has nothing to do with mod_rewrite.
It's used to do Symbolic links within the server environment itself. An example would be, a web directory might have a category that's located under
/Business-and-Economy/Automotive/
In that category of Automotive you might see a sym link to Insurance that looks like so:
Insurance @
That URL to Insurance has the URL of:
/Business-and-Economy/Insurance/
Using symbolic links the server can be told to map the URL as a "short cut" to this link.
However, most directories just use the "at" sign @ following the link and create the link in plain HTML due to the complexities involved in using symbolic links within the server.
I probably didn't do this explanation any justice ... because I'm actually working on my own stuff at the moment and am pressed for time. However, perhaps ArmenT might drop back in and expand upon this a bit more?
:)
WebSavvy
09-05-2006, 13:14/01:14PM
symbolic links (http://www-uxsup.csx.cam.ac.uk/~jw35/courses/apache/html/c987.html)
JohnC
09-05-2006, 13:53/01:53PM
Originally posted by ArmenT
<nitpick>
Off the bat, I spotted a couple of small errors in your article:...
</nitpick>Please do .. :)
I want the info to be accurate and I am not a coder .. I tried to find code examples online and I guess I didnt pick the best.
If you want to send me correct examples .. I would love to update it with better code ..
Thank you very much for the feedback .. :)
g1smd
09-05-2006, 19:31/07:31PM
The base tag can contain just the root domain of the site, or it can contain the full URL of the document that it appears in.
There are many reasons for using each of those, and different effects in doing so. Be aware that unqualified links on the page are joined with whatever is in the base tag to make a full URL, so you need to be very careful that you don't construct links that point to pages that do not exist.
If the base tag contains just the domain, then all internal URLs in links need to start with a / for links, images, links to CSS and JS files etc.
If the base tag contains the full URL of the page that it is on, then the links can be relative. This is dangerous as a small typo can lead to big problems. I always use URLs that start with a / at the beginning.
Comeran
09-05-2006, 20:10/08:10PM
I have seen some clients that don't work server side, so I normally do the normal .htaccess 301 redirect and then place a client side redirect in that area just in case server side didn't work.
Comeran-
Connie
09-05-2006, 20:36/08:36PM
If the base tag contains just the domain, then all internal URLs in links need to start with a / for links, images, links to CSS and JS files etc.
that is my understanding.
That leads me to another question. What about a site that is in transition? Most of my relative links do not begin with (/). So what is the recommendation in this situation.
gnew
13-05-2006, 19:00/07:00PM
The absolute correct code for a base href that I learned in 1996 is
<base href="http://www.foo.com/">
The ending / is critical
For moving a site or a site in transition W3C says that a 301 permanent re-direct is THE way to go. Obviously if you are killing a domain and no longer want anyone to see it in a search engine this will eliminate the issues of penalization.
IF, however, you have a domain that people are likely to type say coke.com and coca-cola.com I prefer to use the base href.
EVERYONE else on this site (I think) does NOT agree with me though. :)
ihelpyou
13-05-2006, 19:14/07:14PM
Of course not, because if you are really using that domain for type-ins only, you have no reason to use the base href as you don't want the se's to index that domain anyway. 301 is what you should use. You run the risk of your main domain being dropped doing what you are.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.