New Zenner
- Join Date:
- Jul 2009
- Posts:
- 35
- Plugin Contributions:
- 0
How can I add www before my domain name
I tried editing configure.php but it didn't change. Can someone help me.
Views: 1,544
New Zenner
I tried editing configure.php but it didn't change. Can someone help me.
New Zenner
Ok, it do change when I go on a section to add it. Can I force the add of www when people don't enter it?
Black Belt
Editing the two configure.php files (one in /includes and one in admin/includes) should change it. Are you changing the permissions of those files first, so they are writable?
Totally Zenned
You can do this by adding a rule to the .htccess file. Or creating an .htaccess file if you don't have one. The rule will look like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
You don't need the first line if it already exists in your .htaccess file.
There is lots of information about htaccess online but you could start with:
http://httpd.apache.org/docs/1.3/howto/htaccess.html
What Stevesh says is good advice too ( we were typing at the same time). It is worth having a htaccess rule like this for all kinds of reasons, though.
Nick
iszent.com
New Zenner
I made the change to both configure.php files. I can't find .htaccess file. Where do I have to look for it or what is the code of such a file if I need to make one?
Totally Zenned
Firstly, it is a hidden file so is easy to overlook (that's the dot at the start of the name) , but it is not part of Zen Cart default install so it is quite possible you do not have one.
Create a blank file with a text editor.
Copy that code into it , edited to match your domain name.
Save it as .htaccess
Upload it to the root of your site.
Should work.
Nick
iszent.com
Tell staff why this post should be reviewed.