Text Size
Sunday, February 23, 2020
Latest Learn Tips How to Get Rid of That Stupid WWW at the Front of Your Joomla URL

I've spent the better part of my free time over the past two or three days trying to get rid of the www version of my website.


Well, one reason is just to do it and learn something... but the primary reason is because things like Google apparently can be mislead into thinking that MarlinCreek.com and www.MarlinCreek.com are two different sites... and that's not really a good thing.

In the end, it seems simple... if you know two things...


The first thing to know is How-To-Do-That.  This you can find in lots of different places online by searching phrases like... "remove www from url" and "mod_rewrite remove www from url"... or any combination of "www", "remove", "redirect", "mod_rewrite" etc...


To save you some time here is the basic format that you will find most often.

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

There are some slight variations on this as well as some more advanced ways that will work universally across multiple sites.

A sub-item of knowing that chunk of code is knowing where to put it... and that is, in your .htaccess file on your server.  I'm not going to go into details about that because A) I'm too lazy right now, and B) Others can explain it much better.

OK - you know what to put and where to put it... so what's the second super simple thing that you need to know?

When dealing with Joomla and the .htaccess file... order is important.

You can try to just add that bit of code at the bottom of the .htaccess file where it is convenient... and then spend two days trying to figure out what is wrong... or you can move that chunk of code up towards the top so that it falls right behind this...

#  mod_rewrite in use
RewriteEngine On

And that is all you need to know about getting rid of the stupid WWW on your Joomla site URL.


blog comments powered by Disqus

Marlin Creek Feedburner Feed