Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Canonical issue 1

Status
Not open for further replies.

ralphonzo

Programmer
Apr 9, 2003
228
0
0
GB
I ran a WooRank review on a site and received a " redirect to www" error. I have a link rel="canonical" on the site as follows: <link rel="canonical" href=" />, but it still doesn't like it. I've set up a .htaccess file but frankly don't know what's required in there. Content as follows:

Code:
 RewriteEngine On
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^thesiteinquestion.com/$ [NC,OR]
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^[URL unfurl="true"]www.thesiteinquestion.com/$[/URL] [NC]
RewriteRule ^(.*)$ [URL unfurl="true"]http://www.jbsportsmassagetherapy.com/$1[/URL] [r=301,nc]

The meta link and .htaccess file were not in place concurrently.

I've seen several other workarounds, but they're so confusing I just didn't know where to start with them.

Can anybody help?
 
I ran a WooRank review on a site and received a " redirect to www" error

Just ignore the stupid so-called 'tools'.

If you put domainname.tld into the browser address bar, where do you get directed to?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Ok so if I have interpreted your (incorrect) rewrite rules appropriately, you want to send all requests for:

( thesiteinquestion.tld

to


instead?

Next, is adifferentdomain.tld on the same server and aliased to thesiteinquestion.tld or is it a seperate entity?


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Simple.

Code:
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^yourdomain\.tld
RewriteRule ^(.*)$ [URL unfurl="true"]http://www.yourdomain.tld/$1[/URL] [R=permanent,L]



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
The canonical link element does NOT do anything other than inform search engine indexers that the 'www' subdomain is the preferred (hence the name canonical) version.

and it still doesn't work with or without the backslash in the RewriteCond line.

Is this website running on Linux?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Oh, I see! I was expecting it to redirect. That's cool then, thanks. Does the canonical meta tag do the same thing? It is running on Linux, yes.
 
Yes the canonical meta is the same, the only meta element that will trigger a redirect is a meta refresh, but this cannot be used for 'canonical' redirecting, because it will create an infinite redirect loop as the same document is being served for both ' and 'domain.tld requests.


It is running on Linux, yes.
Okay as the hosting is Unix/Linux based, .htaccess rewrites with function as expected then.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top