Zen Cart Logo
Forums / General Questions / Issues with my Test Site

Issues with my Test Site

Views: 957

Results 1 to 7 of 7
8 Oct 2011, 3:39 PM
#1
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Issues with my Test Site

Have set up a test site (in a subfolder: domain.com/testsite/zen-cart) in preparation for doing an upgrade. The test site homepage is different to the live site as you would expect and clicking on a link in the sidebar remains on the test site. However clicking on the subcategories and header/footer links takes you to the live site rather than the test site version of that page. I hope that makes sense. The test site version of admin seems to be working fine.

Obviously there is something I have not done and no doubt it's something very simple - what have I missed? Also is there a way to force all links (even those within page text) to go to the test site or does each individual link have to be changed manually?

Also (don't know if this is connected) after clicking on a few links from the test site homepage I got the following errors:

Warning: Variable passed to each() is not an array or object in /public_html/testsite/zen-cart/includes/classes/db/mysql/query_factory.php on line 114

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /public_html/testsite/zen-cart/includes/classes/db/mysql/query_factory.php:114) in /public_html/testsite/zen-cart/includes/functions/sessions.php on line 108

Warning: Cannot modify header information - headers already sent by (output started at /public_html/testsite/zen-cart/includes/classes/db/mysql/query_factory.php:114) in /public_html/testsite/zen-cart/includes/init_includes/init_templates.php on line 78

On other pages I am also getting:

Warning: Cannot modify header information - headers already sent by (output started at /public_html/testsite/zen-cart/includes/classes/db/mysql/query_factory.php:114) in /public_html/testsite/zen-cart/includes/classes/seo.url.php on line 1246

Warning: Cannot modify header information - headers already sent by (output started at /public_html/testsite/zen-cart/includes/classes/db/mysql/query_factory.php:114) in /public_html/testsite/zen-cart/includes/classes/seo.url.php on line 1247

I'm afraid I'm a bit lost so any help welcome.

Thank you!

8 Oct 2011, 5:26 PM
#2
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Re: Issues with my Test Site

Right after lots of fiddling the error messages seem to have gone (for now) but I still have the problem of not being able to stay on the test site - if I click on sidebar link from the homepage, although that page has the testsite url, all links on the page go to the live site.

I've also changed the site logo to one that is obviously the test site to avoid confusion later however that is only showing on the homepage. All other pages (even those with test site url) have the live site logo.

Help!

8 Oct 2011, 5:29 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Issues with my Test Site

Sounds like the URLs in your HTTP_SERVER and/or HTTPS_SERVER settings of your /includes/configure.php file are pointing to the wrong place.

When setting up a test site, you should run zc_install to create the configure.php contents. And, then if you choose to copy any files from your other site over, DO NOT REPLACE the configure.php files, because they are site/folder/database specific.

8 Oct 2011, 6:12 PM
#4
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Re: Issues with my Test Site

Thank you DrByte. I did run zc_install, and all other files are a copy of the live site. I've changed something in .htaccess and it seems to be working now.

The site has a LOT of links within page text (plus header/footer links) and obviously these links point to the live site - is there a quick way of solving this or does each link have to be changed manually :shocking: I'm hoping not the latter as that will be a very long job!

8 Oct 2011, 6:17 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Issues with my Test Site

All the URLs that Zen Cart builds from its built-in features are "relative" URLs, assembled in conjunction with the domain name specified in your configure.php files.

But if you hard-coded absolute URLs into your template or other files when you designed your site, then you'll have to manually change them all if you want them to point someplace else.

Also, if you have "rewrite" rules added to your .htaccess files, you should disable those in your test site else they'll interfere with normal operation.

8 Oct 2011, 7:02 PM
#6
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Re: Issues with my Test Site

DrByte:

All the URLs that Zen Cart builds from its built-in features are "relative" URLs, assembled in conjunction with the domain name specified in your configure.php files.

But if you hard-coded absolute URLs into your template or other files when you designed your site, then you'll have to manually change them all if you want them to point someplace else.

I suspected that was the case. Oh well...

DrByte:

Also, if you have "rewrite" rules added to your .htaccess files, you should disable those in your test site else they'll interfere with normal operation.

Is that all rewrite rules? I've got:

RewriteEngine On
RewriteBase /testsite/zen-cart/

RewriteCond %{QUERY_STRING} currency=EUR$ [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/zen-cart/$1? [R=301,L]

RewriteCond %{HTTP_HOST} !^www.domain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/zen-cart/$1 [R=301,L]

Plus a load of manual redirects of old defunct urls which I understand can be deleted. Also the rewrites for SEO URLs.

Do they all need to go?

Thank you.

8 Oct 2011, 7:05 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Issues with my Test Site

If they're causing you problems, then remove them.