Redirect non www to www

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Post Reply
jj9010
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Feb 05, 2020 7:11 am

Redirect non www to www

Post by jj9010 » Wed Feb 05, 2020 9:35 am

Hi all, I'm still new with Joomla and I would like to know how to redirect from non www to www.

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com [NC] 
RewriteRule ^(.*)$ https://www.abc.com/$1 [L,R=301]
I've added item as above in .htaccess but the redirection still does not work.
My question is:
1. Do I need to enable Use URL rewriting in Joomla configuration?
2. I'm currently using WAMP, do I need to restart WAMP whenever I do changes in .htaccess file?
What else did I miss out? I'm kind of lost right now :( :(

User avatar
bruno28
Joomla! Explorer
Joomla! Explorer
Posts: 482
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Redirect non www to www

Post by bruno28 » Wed Feb 05, 2020 10:13 am

jj9010 wrote:
Wed Feb 05, 2020 9:35 am
Hi all, I'm still new with Joomla and I would like to know how to redirect from non www to www.

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com [NC] 
RewriteRule ^(.*)$ https://www.abc.com/$1 [L,R=301]
I've added item as above in .htaccess but the redirection still does not work.
My question is:
1. Do I need to enable Use URL rewriting in Joomla configuration?
2. I'm currently using WAMP, do I need to restart WAMP whenever I do changes in .htaccess file?
What else did I miss out? I'm kind of lost right now :( :(
Hello jj9010

try this :

Code: Select all

# Redirection vers www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Cordialement, Bruno28 :)
Joomla! 3.9.22 - php 7.4
www.bp2i.fr - www.moneglisesurle.net

jj9010
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Feb 05, 2020 7:11 am

Re: Redirect non www to www

Post by jj9010 » Thu Feb 06, 2020 7:25 am

Hi Bruno 28, what about USE Url rewriting? Do I need to enable that? Do I need to restart WAMP as well?

User avatar
bruno28
Joomla! Explorer
Joomla! Explorer
Posts: 482
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Redirect non www to www

Post by bruno28 » Thu Feb 06, 2020 7:43 am

I think it is better to enable URL rewriting (for another reason)

Yes restart WAMP. Maybe it is necessary when you make changes in .htaccess file (But I don't know, a specialist can answer you)
Cordialement, Bruno28 :)
Joomla! 3.9.22 - php 7.4
www.bp2i.fr - www.moneglisesurle.net

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 6090
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Redirect non www to www

Post by AMurray » Mon Feb 10, 2020 8:39 am

Regardless of using WAMP or similar localhost server, if you're new to Joomla you should know that you're using an out of date/End of Life (as of December 2014) version of Joomla. Otherwise, why are you posting to the 2.5 forum (if using Joomla 3.9.15?).

When you go to roll-out the site live, you will have issues, guaranteed!
Regards,
--------------------------------------------------------------
A Murray
Help you I can, yes!. Post your question, you should. Keep it on topic you must!
Use the Forc....Forum Post Assistant my young Padawan!


Post Reply

Return to “General Questions/New to Joomla! 2.5”