Jump to content

url with or without www


Recommended Posts

The shop is at mohsart.se/handkraft

Putting the line in mohsart.se/handkraft/.htaccess made www->page not found

Putting in in mohsart.se/.htaccess made my other shop inaccessible.

I use windows, but the shop is on linux.

Not sure what you mean with "www in the back office", I use the url without www normally.

 

/Mats

Link to comment
Share on other sites

Ok... I set the domain to www.mohsart.se in preferences/SEO & URLs and it kind of works, but

www is now default, i.e. mohsart.se/handkraft is directed to www.mohsart.se/handkraft - I'd like the oposite behaviour, like I have with mohsart.se.

Some (all?) "sub urls", e.g. mohsart.se/handkraft/sv/ gives me Page not found. Again, I'd like the same behaviour as I have with mohsart.se

 

/Mats

Link to comment
Share on other sites

Hello mohsart,

 

I tried what you were describing and had the same issue. The way I fixed it was to ensure the SEO & URLs section did NOT have www in front of my shop name. After checking that, I added the following code in the .htaccess for the folder where the shop exists:

 

#Force non-www:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC]

RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

 

Now my shop resolves to yourdomain.com even if I enter www.yourdomain.com. I also tested this on different pages around my shop and they all remove the www without giving an error.

 

See if that works for you.

 

Best Regards,

Scott M

  • Like 1
Link to comment
Share on other sites

I actually tried putting this rule in htaccess...

 

all i got was this:

 

 

This webpage has a redirect loop

 

 

I guess i have to put www in the backoffice url...

 

otherwise, I am just not sure...

 

Hello mohsart,

 

I tried what you were describing and had the same issue. The way I fixed it was to ensure the SEO & URLs section did NOT have www in front of my shop name. After checking that, I added the following code in the .htaccess for the folder where the shop exists:

 

#Force non-www:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC]

RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

 

Now my shop resolves to yourdomain.com even if I enter www.yourdomain.com. I also tested this on different pages around my shop and they all remove the www without giving an error.

 

See if that works for you.

 

Best Regards,

Scott M

Link to comment
Share on other sites

I would not advise you to do both since google will see this as duplicate content...

 

ie:

 

www.domain.com/coder-for-hire

domain.com/coder-for-hire

 

You should pick one or the other, then stay with that...

most prof sites go with www.domain.com

 

If you set it up for www.domain.com, then anyone that goes

to domain.com will be pointed over to www.domain.com

 

I feel blind, I cannot find where to change so that the url works both with and without www in 1.5

 

/Mats

Edited by dsimms (see edit history)
  • Like 2
Link to comment
Share on other sites

This may be true for your country but in Sweden www is considered deprecated.

Point taken about google though. Perhaps that's the reason why this feature was removed in 1.5?

I've removed the code from .htaccess and www in BO, but still get page not found when trying to access my shop :-/

 

/Mats

Link to comment
Share on other sites

i am not sure how new your domain is, or if you just recently moved hosts....

 

I just changed hosts myself, moved the files from the old host to the new host,

changed the dns, and for two days I got page not found because i was still

pointed to the old host that no longer had any files, and dns had not fully updated....

 

did you recently change hosts, and dns? if so, you maybe waiting for the dns to fully update.

if this is not the case, then I would know what your issue is, maybe a file was removed,

maybe something got corrupt, i just do not know enough about presta yet...

 

This may be true for your country but in Sweden www is considered deprecated.

Point taken about google though. Perhaps that's the reason why this feature was removed in 1.5?

I've removed the code from .htaccess and www in BO, but still get page not found when trying to access my shop :-/

 

/Mats

Link to comment
Share on other sites

No. ;-)

I removed .htaccess and let PS regenerate it and now it's back to normal. So something was wrong in the file.

I will drop this now since I will move to a new hosting company as soon as I dare i.e. after new year.

BTW I tried scottm's fix again and it doesn't change the behaviour I have without it, possibly because I have one shop in the root and another in a subfolder.

 

/Mats

Link to comment
Share on other sites

Hello mohsart,

 

Let us know how the new host works out for you. At first I had a bit of issue getting the rewrite to work, but it was due to my editing of the .htaccess file. I had the www rewrite crisscrossed with the URL in the BO.

 

Best Regards,

Scott M

Link to comment
Share on other sites

×
×
  • Create New...