The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Mar 03, 2012 4:42 pm 
Joomla! Guru
Joomla! Guru

Joined: Thu May 08, 2008 2:55 pm
Posts: 512
Hi, schooboy error and my mind has gone blank but my new website does not have the www. before the domain name so instead of it looking like www.example.com it shows on the address bar example.com

can anyone let me know what i have done as it was correct last week

many thanks

_________________
In2town Magazine is a popular magazine covering celebrity gossip, travel news, lifestyle news, gadget news and so much more. visit http://www.in2town.co.uk


Top
 Profile  
 
PostPosted: Sun Mar 04, 2012 7:42 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Aug 04, 2006 12:38 pm
Posts: 171
Have you specified your live site URL in the configuration file without the www?

It's a good idea to add the following code to your .htaccess file. Not only will this solve your url showing without the www prefix, it will consolidate all the possible urls people could use to get to your home page into one url so your page rank isn't split between the various urls, which will help your search engine ranking. This will redirect requests for http://mydomain.com or http://mydomain.com/index.php to http://www.mydomain.com

The following htaccess code will take care of www vs. non-www and redirect index.php or index.html or index.htm (take your pick) to /. Note the index.php redirection to http://www.mydomain.com/ is done before non-www to www redirection.

Code:
Options +FollowSymLinks

RewriteEngine On
#
#redirect index.php to / (do this before non-www to www)
# to redirect index.htm and index.html to / change .php to the appropriate suffix(do this before non-www to www)
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php?\ HTTP/
RewriteRule ^(.*)index\.html?$ http://www.mydomain.com/$1 [R=301,L]
#
# redirect mydomain.com -> www.mydomain.com
#
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]


Of course, don't forget to change mydomain.com to your actual domain name.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group