Jump to content

[solved] www infront of domain name


Recommended Posts

Hi,

 

(for better understand go to post #8)

 

I don't know how to get www infront to domain name. I would like to have www.domain.com, instead of this I have domain.com. Do anybody know why?

 

When I set in database to PS_SHOP_URL

www.domain.com

 

and in PS_CONFIGURATION same www.domain.com

 

I will get error 404 page is not available. It works only if both PS_ are filled with domain.com

 

Thank you

Edited by Radek100 (see edit history)
Link to comment
Share on other sites

  On 1/4/2013 at 11:17 PM, Site said:

My shop urls in the database are set not to have www. infront Im using SEO friendly urls which adds the www. back

 

Could we have the link to your website?

sent to pm

 

I use SEO friendly too, but no www. added. But I think that it is caused with htaccess. Maybe...

Edited by Radek100 (see edit history)
Link to comment
Share on other sites

Hello.

 

In order to have the www prefix working correctly for your website, you should also edit the DNS records of your domain name and add a proper CNAME record which should point to the "naked" domain. Don't forget that the www prefix is not a special case but it is handled like any other possible subdomain you could have under your domain (for example vps2.yourdomain.com is not inherently different from www.yourdomain.com or www2.yourdomain.com).

 

You may also have to make some adjustments in your web server's configuration. For example, if your website host uses the Apache web server, you may need to edit the Virtual Hosts configuration to accomplish special handling and/or redirection. You could, for instance, have Apache automatically rewrite all requests for the naked domain to ones including the www prefix. So, a visitor that enters http://yourdomain.com in his web browser would automatically land on http://www/yourdomain.com. Similar functionality can be achieved with other web servers also, e.g. nginx, lighttpd etc.

Link to comment
Share on other sites

I really need help, don't know what is better. Now all my old site is loaded to search engines, like google etc. with www. - all links include this - which work with old prestashop 1.4.x

 

Now I upgrade to prestashop 1.5.3.1. and all my site work only without www so all links looks like http://domainname.com/....

 

So if I go to my website through search engine all loaded pages to google show 404 page not found in my shop.

 

solution which works me is to add this code into htaccess:

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

 

but I this is not solution for redirect link www.domain.com/en/index which I have loaded in one most used searcher

 

I don't know if is better to redirect all pages to http://domain.com.... or solve this problem to add www infront of domain name

 

Please help, it's really urgent

 

Is possible to add or change htaccess to redirect http://www.domain.com/en/index to http://domain.com/en/

Edited by Radek100 (see edit history)
Link to comment
Share on other sites

  On 1/5/2013 at 3:19 PM, MEG Venture said:

Did you try to remove the additional lines from .htaccess, then set SEO&URL settings with www infront and then regenerate the .htaccess file?

 

Again, I would check the cpanel settings for the domain anyway.

 

Oh man, I removed those lines and add www into SEO&URL and it is working now. I read somewhere that in into database I should put domain.com without www. so I wrote only domain.com to PS_SHOP_URL

 

Thank you so much, you saved my life :-), (it was strange to me because I got some error on home page of BO, because I was logged in domain.com/admin and it is necessary to log out and log in to www.domain.com/admin then error doesn't appear

 

I need only last think: redirect old www.domain.com/en/index (it is loaded to one search engine and show 404) to www.domain.com/en/ or www.domain.com/en/index.php (I think it is same result)

 

It will be this?

# URL rewriting rules
RewriteRule ^index /cs/index.php [R=301,NC]

 

or like this?

 

# URL rewriting rules
RewriteRule ^index$ /cs/index.php [R=301,NC]

 

Tried both, no one works me :-(

Edited by Radek100 (see edit history)
Link to comment
Share on other sites

  On 1/5/2013 at 3:53 PM, MEG Venture said:

Please try this:

 

//301 Redirect Old File
Redirect 301 http://www.domain.com/en/index http://www.domain.com/en/index.php

 

When I add this code my site stop working no one page. I will get error 500.

 

I tried

# URL rewriting rules
RewriteRule www.domain.com/en/index www.domain.com/en/index.php [R=301,NC]

 

no effect :-(

 

should't be it this way? instead of // this#

#301 Redirect Old File
Redirect 301 http://www.domain.com/en/index http://www.domain.com/en/index.php

Edited by Radek100 (see edit history)
Link to comment
Share on other sites

I got it!!! YES

 

# Redirect
Redirect 301 /en/index http://www.domain.com/en/index.php

 

Oh I'm so glad. There should't be domain name in first code, don´t know why, but it works, that's important. But thank you so much, I owe you a hour of your life :-). Thank you for your time! I appreciate it.

Edited by Radek100 (see edit history)
Link to comment
Share on other sites

  On 1/5/2013 at 3:37 PM, Radek100 said:

Oh man, I removed those lines and add www into SEO&URL and it is working now. I read somewhere that in into database I should put domain.com without www. so I wrote only domain.com to PS_SHOP_URL

 

Thank you so much, you saved my life :-), (it was strange to me because I got some error on home page of BO, because I was logged in domain.com/admin and it is necessary to log out and log in to www.domain.com/admin then error doesn't appear

 

I need only last think: redirect old www.domain.com/en/index (it is loaded to one search engine and show 404) to www.domain.com/en/ or www.domain.com/en/index.php (I think it is same result)

 

It will be this?

# URL rewriting rules
RewriteRule ^index /cs/index.php [R=301,NC]

 

or like this?

 

# URL rewriting rules
RewriteRule ^index$ /cs/index.php [R=301,NC]

 

Tried both, no one works me :-(

 

where is the additional line .htaccess should be removed? please show me, i have same problem

Link to comment
Share on other sites

×
×
  • Create New...