Welcome, Guest
Username Password: Remember me

301 redirect issue
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: 301 redirect issue

301 redirect issue 12 years, 2 months ago #12351

  • LAMF
  • OFFLINE
  • Senior Boarder
  • Posts: 66
  • Karma: 1
I have set up a 301 redirect rule in the .htaccess file in the root directory in my joomla site all according to how it should be done. 
The code looks like this, and is entered directly after the "RewriteEngine On", like this:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^gagneffiske.se
RewriteRule (.*) www.gagneffiske.se/$1 [R=301,L]


What this does is simply to redirect all urls without www. in front to the www.gagneffiske.se url to avoid double indexing in google. It works fine but not with Mobile Joomla as it seems...
Mobile Joomla seem to loose mobile site detection when activating this code.
Now as this is a very important thing to redirect urls either with www or without www like I have done it would be great if there is a solution to this.
It affects all my sites except for one which makes this even more weird.
The site that this script doesn't seem to affect the Mobile Joomla functionality is www.lmiab.se

So please witgh sugar on top if anyone has a solution to this it would be great.

Cheers
LAMF
Last Edit: 12 years, 2 months ago by LAMF.

Re: 301 redirect issue 12 years, 2 months ago #12376

  • LAMF
  • OFFLINE
  • Senior Boarder
  • Posts: 66
  • Karma: 1
I found a dead simple solution to it.

I simply changed the redirect to make all www. entries going to the url without www, like this:

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


This works but why it wont work the other way is a little mystery to me. 
But if someone with heavy SEo knowledge say to me that you should use www. urls not without www then I guess I have to find a solution for making both the redirect and Mobile Joomla to work together.
But I would guess either way works as long as the urls are not duplicated.

Re: 301 redirect issue 12 years, 1 month ago #12436

  • LAMF
  • OFFLINE
  • Senior Boarder
  • Posts: 66
  • Karma: 1
Well it is a solution but if you wanted to redirect from yourdomain.com to www.yourdomain.com then it wont work so still if Denis or someone at the MJ developers could tall us why this is happening then it would be even better.
Last Edit: 12 years, 1 month ago by LAMF.

Re: 301 redirect issue 11 years, 7 months ago #14716

  • saif
  • OFFLINE
  • Banned
  • Corporate Training and Development Programs - Trai
  • Posts: 3
  • Karma:
Sposs If i don't redirect www or without www what up. I am new in SEO don't know what is 301 do you explain what is this and how use it.

Re: 301 redirect issue 11 years, 6 months ago #14938

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www [NC]
RewriteRule (.*) www.%{HTTP_HOST}/$1 [R=301,L]

try this code and see if it works for you

Re: 301 redirect issue 11 years ago #16671

  • faizahmed
  • OFFLINE
  • Fresh Boarder
  • Web Design
  • Posts: 1
  • Karma: 0
Can you tell in details what is the Benefits of 301 redirect. I read many time in SEO i have little bit knwo about SEO I can't explain your in details.
  • Page:
  • 1
Time to create page: 0.13 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.