Web Hosting, Design, & Coding forum


How I can resolve canonicalization Issue?

by FunkiTech / February 27, 2014 8:00 PM PST

Hello Friends,

I have a website and canonical issue is related to it, the homepage of website is loaded with 4 different URL like with and without www , so how i can resolve this problem?
PLZ suggest me.

Discussion is locked
You are posting a reply to: How I can resolve canonicalization Issue?
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: How I can resolve canonicalization Issue?
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.

All Answers

Collapse -
The way you resolve that
by Sovereign Forum moderator / February 27, 2014 10:52 PM PST

is to setup redirects for your aliases.

For example, if you're using Apache, I'm assuming you have a virtual host that looks something like this:

<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com another.domain.com

Which means the server will serve the DocumentRoot to all aliases as well.

Now, to prevent that, you need to setup a redirect.

One example would be to redirect www to non-www:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^/(.*)$ http://domain.com/$1 [R=301,L]

Another example might be to redirect any subdomain to non-www:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain\.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]

For even more examples, simple search for "redirect www to non-www" or if you want to include the www in your URLs, vise versa.


Collapse -
You would talk to your DNS maintainer.
by R. Proffitt Forum moderator / February 27, 2014 10:55 PM PST
Collapse -
Solutions for solve canonical issue
by maryjohn01 / March 5, 2014 3:08 PM PST


I am mary john. if your website is on Linux Server then sure below code will work for solve canonical issue.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com /$1 [L,R=301]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

You have to copy and paste above code in .htaccess file . You have change only website name in above code.

I hope it will be helpful for you.

Mary John

Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Help, my PC with Windows 10 won't shut down properly

Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?