JavaScript Editor Ajax software     Free javascripts 

Main Page

The solution we’re proposing is to do 301 redirects to a single “standard” version of the link. Lucky you,
the functionality is already there! The
function from
already takes care to redirect any errant or outdated link to its “proper” version, in case the
URL isn’t already what it should be.
Trying to load any of the two previously mentioned links would simply redirect you to:
Dealing with Multiple Domain Names Properly
Though it’s less popular these days, some people desire to have multiple domain names pointing to the
same site. For example, say you have three domain names:
The problem is that, especially if you market all three domains, people are free to link to any of these
domains. That’s a major duplicate content issue. You must pick a “standard” domain and permanently
redirect the other domains to that domain.
Let’s pick
. This is how to do it with mod_rewrite:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^(.*)$$1 [R=301,L]
Done! Now everything will get redirected to
. Let’s analyze the rules in detail.
This is the first time you’re using
. You use
to place a condition for the
rule that follows. In this case, you’re interested in verifying that the site has been accessed through
. Take another look at the
RewriteCond %{HTTP_HOST} !^www\.example\.com
This line specifies a condition that is true when the host name (
) is not (
. The rewrite rule captures the entire query string of the original URL, as
, and passes it to
, doing a 301 redirect to the new location. This way, for example, a query
would be 301 redirected to
Using Redirects to Change Domain Names
Sometimes you
to change your domain name. Usually this happens in M&A (mergers and acquisi-
tions) cases. Although undesirable, there is a right way to do this, and many wrong ones. Typically both
domains need to point to the same web site now that the merger occurred. The
thing you can do is
simply point both domains to the same content via DNS. This will result in search engines not knowing
Chapter 4: Content Relocation and HTTP Status Codes
c04.qxd:c04 10:40 90

JavaScript Editor Ajax software     Free javascripts 
Bitcoin Gambling Site