www domain redirects to non-www domain

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
zkos
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Sep 04, 2014 10:57 am

www domain redirects to non-www domain

Post by zkos » Thu Sep 04, 2014 11:05 am

Hello!
I built my website using Joomla 3 and I have a question regarding the canonical url: the www version of my domain (http://www.domain.com) redirects to the non-www version (http://domain.com)
I didn't change anything in .htaccess, it just started the moment I installed Joomla, so I guess it's just the default configuration of Joomla 3.
I know it doesn't affect SEO on my website, but I am just wondering: Is it possible to make it work the other way round, that is, the non-www version redirects to the www version?
Thanks in advance for your time! Any help is welcome!

User avatar
fcoulter
Joomla! Ace
Joomla! Ace
Posts: 1685
Joined: Thu Sep 13, 2007 11:39 am
Location: UK
Contact:

Re: www domain redirects to non-www domain

Post by fcoulter » Thu Sep 04, 2014 11:55 am

There is nothing in the default Joomla installation that redirects either from www version of the domain or the other way around.

It might help if you could give the actual url of your site, then it will be possible to look at the .htaccess to see if there is anything in it that would cause this.

Also it is possible that a system plugin could be doing this, take a look at the system SEF plugin, see if the canonical url has been added there, if you are using any SEF extension they may well have their own plugins that are creating the redirect. Also check your configuration.php file, look to see if anything has been set for the live_site parameter.
http://www.spiralscripts.co.uk for Joomla! extensions
http://www.fionacoulter.com/blog my personal website
Security Forum moderator :: VEL team member
"Wearing my tin foil hat with pride"

zkos
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Sep 04, 2014 10:57 am

Re: www domain redirects to non-www domain

Post by zkos » Thu Sep 04, 2014 3:25 pm

Thanks for the reply!

I've already checked all these. The .htaccess file is the default file that comes with Joomla 3.3 (actually it's htaccess.txt)
The canonical url at the system SEF plugin is empty and also the value of the live_site parameter is empty...

I have no idea why this is happening... :eek:

User avatar
fcoulter
Joomla! Ace
Joomla! Ace
Posts: 1685
Joined: Thu Sep 13, 2007 11:39 am
Location: UK
Contact:

Re: www domain redirects to non-www domain

Post by fcoulter » Thu Sep 04, 2014 6:48 pm

It would still help to be able to see the actual site.
http://www.spiralscripts.co.uk for Joomla! extensions
http://www.fionacoulter.com/blog my personal website
Security Forum moderator :: VEL team member
"Wearing my tin foil hat with pride"

zkos
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Sep 04, 2014 10:57 am

Re: www domain redirects to non-www domain

Post by zkos » Fri Sep 05, 2014 8:44 am

Finally, it has to do with the hosting settings on my Plesk panel. There is the "Preferred Domain" option where the default value is the non-www version of the domain.
Thanks again for all your help and sorry to have wasted your time... :-[

User avatar
fcoulter
Joomla! Ace
Joomla! Ace
Posts: 1685
Joined: Thu Sep 13, 2007 11:39 am
Location: UK
Contact:

Re: www domain redirects to non-www domain

Post by fcoulter » Fri Sep 05, 2014 5:11 pm

No problem - fixing a problem like this is often a matter of just ruling out everything you can think of. If you had not asked the question you would probably still be thinking that this was just something that Joomla does.
http://www.spiralscripts.co.uk for Joomla! extensions
http://www.fionacoulter.com/blog my personal website
Security Forum moderator :: VEL team member
"Wearing my tin foil hat with pride"

monlike
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Fri Jun 06, 2014 10:57 am
Location: sweden

Re: www domain redirects to non-www domain

Post by monlike » Fri Sep 05, 2014 5:44 pm

i think better solution for this problem
use google webmaster tools

JamesTeters
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sun Sep 07, 2014 10:12 pm

Re: www domain redirects to non-www domain

Post by JamesTeters » Sun Sep 07, 2014 10:57 pm

Use this format if you want a request for any URL at www.example.com to redirect to the same page at example.com

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com [nocase]
RewriteRule ^(.*) http://example.com/$1 [last,redirect=301]

User avatar
fcoulter
Joomla! Ace
Joomla! Ace
Posts: 1685
Joined: Thu Sep 13, 2007 11:39 am
Location: UK
Contact:

Re: www domain redirects to non-www domain

Post by fcoulter » Mon Sep 08, 2014 11:08 am

Yes, generally this will work if there are no other redirects in place, but the problem that zkos had was that there was already a redirect in place, redirecting from http://www.example.com to http://example.com, what he/she needed to know was what was causing it and how to stop it.

And just putting in another redirect from http://example.com to http://www.example.com into the .htaccess file would almost certainly not be the solution, you can easily end up with an infinite redirect loop in that situation, making the site completely inaccessible.
http://www.spiralscripts.co.uk for Joomla! extensions
http://www.fionacoulter.com/blog my personal website
Security Forum moderator :: VEL team member
"Wearing my tin foil hat with pride"

coquilla18
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Thu May 29, 2014 9:27 am

Re: www domain redirects to non-www domain

Post by coquilla18 » Mon Oct 06, 2014 6:10 am


onlinershub
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Oct 03, 2014 8:55 am
Location: Philippines
Contact:

Re: www domain redirects to non-www domain

Post by onlinershub » Fri Oct 10, 2014 2:13 pm

These are canonical issues. By default, it will result to a www and non-www unless you will specify which one you want it apply.

tasolglobal2014
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Tue Feb 18, 2014 10:15 am
Location: Ahmedabad, India
Contact:

Re: www domain redirects to non-www domain

Post by tasolglobal2014 » Sat Oct 11, 2014 6:14 am

As per my experience you should go with third party extension like "SH404SEF". Once you install the extension then go to the configuration and then go to the "advance setting" tab, there you will find an option which say's "Enforce website with www or non www" you just need to select the www option and your problem will be solved.

Now you will find your website will automatically open with "www"

Hope it will be helpful for you.

User avatar
fcoulter
Joomla! Ace
Joomla! Ace
Posts: 1685
Joined: Thu Sep 13, 2007 11:39 am
Location: UK
Contact:

Re: www domain redirects to non-www domain

Post by fcoulter » Wed Oct 15, 2014 10:57 am

Clearly you have not read the previous posts properly. zkos stated clearly it was a setting in the plesk control panel and was now fixed.

Doing as you suggest in this circumstance would definitely not be the solution, it would result in an infinite loop, which means that any request would be automatically redirected to the non www site by the plesk setting, then redirected back from there to the www site by sh404sef, and so on ad-infinitum. It would completely crash the site.

Really this problem has been solved, there is nothing further that needs to be added.
http://www.spiralscripts.co.uk for Joomla! extensions
http://www.fionacoulter.com/blog my personal website
Security Forum moderator :: VEL team member
"Wearing my tin foil hat with pride"

coquilla18
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Thu May 29, 2014 9:27 am

Re: www domain redirects to non-www domain

Post by coquilla18 » Tue Dec 02, 2014 4:41 am

This article will teach you on how to redirect www to non-www or vice versa
check the link.. cheers!
http://www.sanitypost.com/how-to/33-how ... w-url.html


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”