Zen Cart Logo
Forums / General Questions / URL issue

URL issue

Views: 2,316

Results 1 to 20 of 30
9 Dec 2010, 8:22 PM
#1
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

URL issue

Hi all,

Just a quick question.

In my browser i type

http://www.mydomain.co.uk

It loads fine, with no issues at all, then when i click on a product or any other link on the site it just goes to

http://mydomain.co.uk/whatever

Is there anyway to resolve this as i expect it will cause major issues when i come to putting my dedicated SSL on, and it most likley wont work for the entire site (as it has to be one or the other as far as im aware)

Cheers

9 Dec 2010, 9:11 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: URL issue

Try googling

htaccess add www
10 Dec 2010, 10:04 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

It loads fine, with no issues at all, then when i click on a product or any other link on the site it just goes to

Make sure that the 'www' is in both of your configure.php files

  define('HTTP_SERVER', 'http://[B]www[/B].mydomain.co.uk');
  define('HTTPS_SERVER', 'https://[B]www[/B].mydomain.co.uk');

Then to globally force the www so that you get no duplicate content add to your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.ymydomain.co.uk$
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [R=301]

Replacing "mydomain.co.uk" with your actual domain name

10 Dec 2010, 1:54 PM
#4
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

Make sure that the 'www' is in both of your configure.php files

define('HTTP_SERVER', 'http://[B]www[/B].mydomain.co.uk');
define('HTTPS_SERVER', 'https://[B]www[/B].mydomain.co.uk');

> Then to globally force the www so that you get no duplicate content add to your .htaccess file
> ```
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.ymydomain.co.uk$
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [R=301]

Replacing "mydomain.co.uk" with your actual domain name

thanks for that.

Where abouts will the .htaccess file need to be located?

and im also asuming that the rewrite rule can be done with https:// too?!

10 Dec 2010, 2:21 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

Where abouts will the .htaccess file need to be located?
The root of your ZenCart

im also asuming that the rewrite rule can be done with https:// too?!
Try it without as I believe it takes that into account - - besides this is so you do not get a penalty for duplicate content mostly or so your http pages can not be accessed without the www
Your secure pages should not be indexed any way

10 Dec 2010, 3:44 PM
#6
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

The root of your ZenCart

Try it without as I believe it takes that into account - - besides this is so you do not get a penalty for duplicate content mostly or so your http pages can not be accessed without the www
Your secure pages should not be indexed any way

I did what you said in your earlier post. Worked perfectly.

Many thanks for that.

Will let you know how i get on when my SSL has come through.

10 Dec 2010, 3:56 PM
#7
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

Slight issue, when i have uploaded it and go to log into my site via admin section it wont let me login

IE.

When the correct username and password are entered it just refreshes itself and both boxes go blank.

When i delete the .htaccess file i can then log in.

should this happen ??

does my domain name need to be replaced in both sections ( i asumed this already) or does the

RewriteCond %{HTTP_HOST} !^www.ymydomain.co.uk$

need to be my reseller/hosting company im with?
slightly confused now

10 Dec 2010, 4:28 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

When i delete the .htaccess file i can then log in.

should this happen ??

does my domain name need to be replaced in both sections ( i asumed this already)
No that is not how it should work
The admin by default has it's own htaccess
Are you using some SEO rewrite?

What all is in the htaccess that is at the root?

need to be my reseller/hosting company im with?
No to this also - - You do not use anything related to them to load your site do you?

10 Dec 2010, 4:33 PM
#9
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

What all is in the htaccess that is at the root?

I dont understand what you mean?

Should i look at the .htaccess file in the admin section too ?

10 Dec 2010, 4:49 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

I dont understand what you mean?
What is the contents of the root htaccess

Should i look at the .htaccess file in the admin section too ?
No if you haven't messed with it leave it alone

10 Dec 2010, 4:55 PM
#11
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

What is the contents of the root htaccess

No if you haven't messed with it leave it alone

I havent touched it and wont then.

and all the .htaccess is is this:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.martinpollardart.co.uk$
RewriteRule ^(.*)$ http://www.martinpollardart.co.uk/$1 [R=301]

Uploaded to public_html where all the base files and folders are sat in, so the root directory

10 Dec 2010, 5:21 PM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

Did you add the www to both the configure.php files??

10 Dec 2010, 5:25 PM
#13
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

What is the contents of the root htaccess

No if you haven't messed with it leave it alone

kobra:

Did you add the www to both the configure.php files??

yep the one in

includes/configure.php
admin/includes/configure.php

10 Dec 2010, 5:32 PM
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

yep the one in

includes/configure.php
admin/includes/configure.php
Check the actual file on the server that it actually contains the edits for both

10 Dec 2010, 5:39 PM
#15
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

Check the actual file on the server that it actually contains the edits for both

i am doing now, just crossed my mind.

Looks like ite reverting back or not doing it.

10 Dec 2010, 5:42 PM
#16
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

Looks like ite reverting back or not doing it.
Use your hosts filemanager to change permissions from most likely 444 to 644
Upload them and change permissions back to 444

10 Dec 2010, 5:54 PM
#17
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

Use your hosts filemanager to change permissions from most likely 444 to 644
Upload them and change permissions back to 444

Managed to get them on, still doing it :(

Any other ideas, maybe a setting thats wrong in my admin section?

10 Dec 2010, 6:10 PM
#18
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: URL issue

Are you working on
http: //martinpollardart.co.uk/

If so, then your frontend configure.php is not set to www

10 Dec 2010, 6:14 PM
#19
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

kobra:

Are you working on
http: //martinpollardart.co.uk/

If so, then your frontend configure.php is not set to www

I am yes, its for my uncle.

And ive just had to swap them all back so i can log into the back office admin area, as even if i leave them with the www. in the configures, and DONT have the .htaccess file in the root directory it still wont let me login

10 Dec 2010, 6:16 PM
#20
jmp04 avatar

jmp04

New Zenner

Join Date:
Dec 2010
Posts:
66
Plugin Contributions:
0

Re: URL issue

Do i not need to change anything out of this ? Aside from the top two lines. (admin/includes/configure.php file)

*/
define('HTTP_SERVER', 'http://martinpollardart.co.uk');
define('HTTPS_SERVER', 'https://martinpollardart.co.uk');
define('HTTP_CATALOG_SERVER', 'http://martinpollardart.co.uk');
define('HTTPS_CATALOG_SERVER', 'https://martinpollardart.co.uk');

// Use secure webserver for catalog module and/or admin areas?
define('ENABLE_SSL_CATALOG', 'false');
define('ENABLE_SSL_ADMIN', 'false');
// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)

define('DIR_WS_ADMIN', '/ADMIN FOLDER/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/ADMIN FOLDER/');
define('DIR_WS_HTTPS_CATALOG', '/');

define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_ADMIN', '/home/sites/martinpollardart.co.uk/public_html/ADMIN FOLDER/');
define('DIR_FS_CATALOG', '/home/sites/martinpollardart.co.uk/public_html/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', '');
define('DB_SERVER_USERNAME', '
');
define('DB_SERVER_PASSWORD', '*****');
define('DB_DATABASE', 'web45-martin77');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'db');
// for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

// The next 2 "defines" are for SQL cache support.
// For SQL_CACHE_METHOD, you can select from: none, database, or file
// If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
// or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
// ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
define('SQL_CACHE_METHOD', 'none');
define('DIR_FS_SQL_CACHE', '/home/sites/martinpollardart.co.uk/public_html/cache');

// EOF