Hi
How do I disable redirects from removing “www.” in the url
I type www.domain.com - I get result domain.com
I wish to keep it as www.domain.com
Thank you
Walt
Edit: config.local.php
```php
// Host and directory where software is installed on no-secure server
$config[‘http_host’] = ‘site.com’;
$config[‘http_path’] = ‘’;
// Host and directory where software is installed on secure server
$config[‘https_host’] = ‘site.com’;
$config[‘https_path’] = ‘’;
```
add WWW there
```php
// Host and directory where software is installed on no-secure server
$config[‘http_host’] = ‘www.site.com’;
$config[‘http_path’] = ‘’;
// Host and directory where software is installed on secure server
$config[‘https_host’] = ‘www.site.com’;
$config[‘https_path’] = ‘’;
```
Thank you for the information
Thank you
You might also want to update your htaccess with:
RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L]
RewriteCond %{HTTPS_HOST} ^site\.com$ [NC]
RewriteRule ^(.*)$ https://www.site.com/$1 [R=301,L]
Answer is there since 2008:
[quote name=‘Lee Li Pop’]Hello,
Try with this:
1 - Open & Edit your “.htaccess” in your root
2 - Add after the last line of your “.htaccess”:
RewriteCond %{HTTP_HOST} www.YourWebsite.com$ [NC]
RewriteRule ^(.*)$ http://YourWebsite.com/$1 [R=permanent,L]
OR REVERSE:
RewriteCond %{HTTP_HOST} YourWebsite.com$ [NC]
RewriteRule ^(.*)$ http://www.YourWebsite.com/$1 [R=permanent,L]
3 - Save
4 - Upload
5 - Try
Hoping to read from you,
Lee Li Pop
PS : Of course! Change “YourWebsite.com” with your REAL website name ;)[/QUOTE]
Source: [url]http://forum.cs-cart.com/showthread.php?p=40133#post40133[/url]
And now, why it’s important in a SEO purpose:
[quote name=‘Lee Li Pop’]Hello Raj,
First of all, thank you to ask good question!
Because…
[COLOR=“Green”]This trick is VERY important for a SEO purpose![/COLOR]
Yes, because, having only one access to your domain URL (with or without “www”), you DO NOT split your PR between “www” and “non www”
United, we are stronger!
*****
You can chose what you need for your domain name URL, [COLOR=“Red”]Without[/COLOR] (1) or [COLOR=“Green”]With[/COLOR] (2) WWW:
1 - [COLOR=“Red”]WITHOUT[/COLOR] “www”, add at the bottom end of your [COLOR=“#ff0000”].htaccess[/COLOR]:
RewriteCond %{HTTP_HOST} www.MyDomainName.com$ [NC]
RewriteRule ^(.*)$ http://MyDomainName.com/$1 [R=permanent,L]
2 - [COLOR=“Green”]WITH[/COLOR] “www”, add at the bottom end of your [COLOR=“#ff0000”].htaccess[/COLOR]:
RewriteCond %{HTTP_HOST} !^www\.MyDomainName\.com$ [NC]
RewriteRule ^(.*)$ http://www.MyDomainName.com/$1 [R=permanent,L]
Of course, change “MyDomainName.com” with your real own domain name!
*****
For personal reasons, I always chose without “www”.
Nota Bene:
This trick is not always technicaly available. Please, check with your hosting company.
Lee Li Pop[/QUOTE]
Source: [url]http://forum.cs-cart.com/showthread.php?p=67911#post67911[/url]
Lee Li Pop