Canonical URL and redirection confusion

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Liibre
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Mon Apr 22, 2013 11:47 am

Canonical URL and redirection confusion

Post by Liibre » Thu Jan 08, 2015 4:05 pm

Hi, I feel like I am in deep water here, so I was hoping someone could help me out.
Our website (http://adventuresbarcelona.com) used to be bilingual (English + Norwegian). Then we moved the Norwegian part to an own domain, and now we have only kept the English site under the .com domain. Now when we check Google Webmaster tools we often get a message about crawl errors, url not found. The URL not found then contains /en/. Which we are not supposed to use anymore because my site just has English as the only language now (?)

When we tried to add a link to one of our news articles on Facebook, no picture showed up. So, we used the Facebook debug tool to see what was wrong. And according to Facebook the fetched url: http://adventuresbarcelona.com has a cononical url which is http://adventuresbarcelona.com/en/
This explains the missing urls in Google Webmaster tools, because the origin is usually links from facebook to our news articles. And I am guessing this is also the reason article images does not show up on Facebook links. I also get a lot of warnings in the Facebook debug tool (look attachment).

The thing is, I have no idea why our canonical url is set to http://adventuresbarcelona.com/en/ and not to http://adventuresbarcelona.com. To be honest I am not quite sure what a canonical url is. Where in Joomla can I change this? I am guessing it might be this way because the site used to be bilingual, but I don't know. The whole thing is quite confusing to me. I would be very happy if you could point me in the right direction and help me fix this. Thanks!
You do not have the required permissions to view the files attached to this post.

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4026
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: Canonical URL and redirection confusion

Post by itoctopus » Thu Jan 08, 2015 5:03 pm

Just do a redirect in your .htaccess file the following way and this should solve the problem (the redirect must be after RewriteEngine On):

Code: Select all

RedirectMatch 301 /en/(.*) /$1
Doing so will mean that Google will not run into any page not found errors (also, you won't have any problems with Facebook).
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

Liibre
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Mon Apr 22, 2013 11:47 am

Re: Canonical URL and redirection confusion

Post by Liibre » Thu Jan 08, 2015 7:18 pm

Thanks for your reply! Now I added your piece of code to the .htaccess file and it kind of works. But when I use Facebook debug, I am getting an even worse error message. Now it also shows:
"Error that mus be fixed: Circular redirect path - Circular redriect path detected (see 'Redirect Paht' for details)." (See attachment)

This in addition to the other "warnings that should be fixed".

I guess editing the .htaccess file is a workaround, but isn't there a way to fix it so that the socalled canonical url is set correct in Joomla?
You do not have the required permissions to view the files attached to this post.

Liibre
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Mon Apr 22, 2013 11:47 am

Re: Canonical URL and redirection confusion

Post by Liibre » Mon Jan 12, 2015 1:11 pm

Any other tips?


Locked

Return to “Administration Joomla! 3.x”