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  [ 4 posts ] 
Author Message
PostPosted: Sun Sep 25, 2011 6:24 pm 
Joomla! Intern
Joomla! Intern

Joined: Sun Dec 28, 2008 12:18 am
Posts: 58
I recently posted a question to google webmasters because my site has been declining rapidly in traffic and rankings.

One of the issues they pointed out was that

Quote:
"Both mysite.com and http://www.mysite.com show the same site, so you have a canonical issue. You need to 301 redirect mysite.com to http://www.mysite.com .


They directed me to this tutorial:

http://sites.google.com/site/onlyvalidation/page/fix-canonical-issues-www-vs-non-www-and-more-on-apache-server

I added their first example to my existing .htaccess file. After doing this, my site appeared just fine from the front end, but if I try to log into the back end, the login page simply refreshes.

I'm attaching a "before" and "after" htaccess file (however in each, I'm substituting my real site name with "mysite.com")

I will appreciate any help!


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: Mon Sep 26, 2011 12:22 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Jul 18, 2008 2:28 pm
Posts: 787
Location: Dinajpur, Bangladesh
Try this piece of code

Code:
########## Begin - Redirect non-www to www
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R,L]
########## End - Redirect non-www to www

########## Begin - Redirect www to non-www
## WARNING: Comment out the non-www to www rule if you choose to use this
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R,L]
########## End - Redirect non-www to www

_________________
Bengali (Bangladesh) Forum Moderator - Joomla Shocase Team Member

http://dinajpur.net - My home district portal, http://rangpurbd.com - Rangpur Portal


Top
 Profile  
 
PostPosted: Mon Sep 26, 2011 2:37 pm 
Joomla! Intern
Joomla! Intern

Joined: Sun Dec 28, 2008 12:18 am
Posts: 58
Thanks Almamun!


That worked.

I appreciate your help.


Top
 Profile  
 
PostPosted: Fri May 11, 2012 1:21 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Jan 10, 2011 7:12 pm
Posts: 5
Location: Guildford UK
Thanks - Simple change that worked for me on http://taybridgeconsulting.com/


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



Who is online

Users browsing this forum: No registered users and 11 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