How do you Redirect non-WWW to WWW in Joomla

parksdesign
16-01-2018 16:11

You will need t your .htaccess file and find the line that reads:

RewriteEngine On

 

To redirect non-www to www, add this code below it:

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

 

To redirect www to non-www, add this code after RewriteEngine On:

RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
Average rating: 0 (0 Votes)

You cannot comment on this entry