Forums / General Questions / How can I add www before my domain name

How can I add www before my domain name

Locked

Views: 1,544

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
4 Dec 2009, 6:23 PM
#1
bebe avatar

bebe

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.

4 Dec 2009, 6:37 PM
#2
bebe avatar

bebe

New Zenner

Join Date:
Jul 2009
Posts:
35
Plugin Contributions:
0

Re: How can I add www before my domain name

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?

4 Dec 2009, 7:08 PM
#3
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How can I add www before my domain name

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?

4 Dec 2009, 7:11 PM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How can I add www before my domain name

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

4 Dec 2009, 8:17 PM
#5
bebe avatar

bebe

New Zenner

Join Date:
Jul 2009
Posts:
35
Plugin Contributions:
0

Re: How can I add www before my domain name

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?

4 Dec 2009, 8:23 PM
#6
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How can I add www before my domain name

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