Actions

Difference between revisions of "Adding www to a url"

From Joomla! Documentation

(Previous code did not canonicalise www URLs with port number, nor direct IP requests. Use example.com, see RFC 2606.)
m (Fixed typo in categorisation.)
Line 9: Line 9:
  
 
[[Category:FAQ]]
 
[[Category:FAQ]]
[[Category::Installation]]
+
[[Category:Installation]]

Revision as of 14:53, 7 March 2011

How do I get www as a prefix in all my joomla sites?

Add the following to your htaccess file

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