Forums / Installing on a Linux/Unix Server / Href on product pages wrong after moving of page

Href on product pages wrong after moving of page

Views: 1,292

Results 1 to 8 of 8
17 Jan 2012, 7:29 AM
#1
danmoto avatar

danmoto

New Zenner

Join Date:
Jan 2012
Posts:
5
Plugin Contributions:
0

Href on product pages wrong after moving of page

Hello,

i'm in the progress of moving my zen cart installation into a new folder on my server.

Actualy i though it would be easy:unsure:

Zencart was/is up and running in the root folder of my server.
Because we want to add some other contect under our domain we decided to move zen cart into a subfolder.

What i did so far:
1)Created new Sub Folder
2) Make copy of existing database ( i wanted to test everything first and keep my page online at the same time)
3) Copied all Zen cart files from root to new Sub Folder
4) Edited the two configure.php files regarding the new folder and DB info

Now i have two running versions of zen cart on my folder.

One in root which is live and customers still ordering. The other one in my subfolder, running on a database copy from yesterday.

The copy in the subfolder load up fine and on the index page are all links correct. base href is correct.
When i open one product page, it changes base href from the subfolder back to root. The page still loads fine, because the other version is still online, but i switched between the two copies.

Here are the links for your reference:

Root Version:
https://www.danmoto.com

Subfolder
http://www.dan-moto.com/DM_US/

Any idea how this happens? I would guess somewhere it should load HTTP_SERVER . DIR_WS_CATALOG, but loads only HTTP_SERVER.

But in which PHP file?
I'm a little lost because i did not setup the page and i have no documentation aboutmodifications which have been carried out on this page.

HELP:cry:

17 Jan 2012, 8:03 AM
#2
danmoto avatar

danmoto

New Zenner

Join Date:
Jan 2012
Posts:
5
Plugin Contributions:
0

Re: Href on product pages wrong after moving of page

Small Update:

The base href changes to the incorrect root value on every page you open. It does not matter if it's a product page or any other.

base href is only correct when the page load up first, after you clicked anywhere on the page, it changes to root on the next page which is loaded.

17 Jan 2012, 8:08 AM
#3
drbyte avatar

drbyte

Sensei

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

Re: Href on product pages wrong after moving of page

Zen Cart builds its URLs from the data in your configure.php files. That's it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Jan 2012, 8:22 AM
#4
danmoto avatar

danmoto

New Zenner

Join Date:
Jan 2012
Posts:
5
Plugin Contributions:
0

Re: Href on product pages wrong after moving of page

@DrByte

Thank you for the fast answer.

The configure.php files are updated to the new path correctly.
I attached a copy of them for review on the end of this post.

What i don't get it that the page initialy loads correctly, but after you follow any link on the page it changes the link value.

Configure.php includes

<?php define('HTTP_SERVER', 'http://www.dan-moto.com'); define('HTTPS_SERVER', 'http://www.dan-moto.com'); define('ENABLE_SSL', 'false'); define('DIR_WS_CATALOG', '/DM_US/'); define('DIR_WS_HTTPS_CATALOG', '/DM_US/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_INCLUDES', 'includes/'); 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_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/'); define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/'); define('DIR_WS_PHPBB', '/DM_US/'); define('DIR_FS_CATALOG', '/home/danmotoc/public_html/DM_US/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DIR_WS_UPLOADS', DIR_WS_IMAGES . '/uploads/'); define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); define('DB_TYPE', 'mysql'); define('DB_PREFIX', ''); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'XXX'); define('DB_SERVER_PASSWORD', 'XXX'); define('DB_DATABASE', 'XXX'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'db'); define('SQL_CACHE_METHOD', 'none'); define('DIR_FS_SQL_CACHE', '/home/danmotoc/public_html/DM_US/cache'); // EOF configure.php admin/includes <?php define('HTTP_SERVER', 'http://www.dan-moto.com'); define('HTTPS_SERVER', 'https://www.dan-moto.com'); define('HTTP_CATALOG_SERVER', 'http://www.dan-moto.com'); define('HTTPS_CATALOG_SERVER', 'https://www.dan-moto.com'); define('ENABLE_SSL_CATALOG', 'false'); define('ENABLE_SSL_ADMIN', 'false'); define('DIR_WS_ADMIN', '/DM_US/admin/'); define('DIR_WS_CATALOG', '/DM_US/'); define('DIR_WS_HTTPS_ADMIN', '/DM_US/admin/'); define('DIR_WS_HTTPS_CATALOG', '/DM_US/'); 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/'); define('DIR_FS_ADMIN', '/home/danmotoc/public_html/DM_US/admin/'); define('DIR_FS_CATALOG', '/home/danmotoc/public_html/DM_US/'); 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', 'localhost'); define('DB_SERVER_USERNAME', 'XXX'); define('DB_SERVER_PASSWORD', 'XXX'); define('DB_DATABASE', 'XXX'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'db'); define('SQL_CACHE_METHOD', 'none'); define('DIR_FS_SQL_CACHE', '/home/danmotoc/public_html/DM_US/cache'); // EOF
17 Jan 2012, 8:35 AM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Href on product pages wrong after moving of page

Your site is using some sort of URL re-write system. This is ALWAYS a bad idea with zencart. It serves no useful purpose (not even for seo) and these mods generally create far more problems than they claim to solve.

What is your reason for using static url's ?

20 years a Zencart User

17 Jan 2012, 8:39 AM
#6
danmoto avatar

danmoto

New Zenner

Join Date:
Jan 2012
Posts:
5
Plugin Contributions:
0

Re: Href on product pages wrong after moving of page

Hello Schoolboy,

thank you for your answer.

Actualy, i would be happy to know what this should do and how i can change it.

The page was setup by somebody else, i do not know what this person changed/modified/added.

I'm just stuck with the result and somehow need to fix it.

Any idea where this function might be located?

17 Jan 2012, 9:03 AM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Href on product pages wrong after moving of page

We have never used these "SEO URL" modules (and never will), so I am not knowledgeable about their set-up.

There may be some issues, however, when removing it.

Despite the fact that these modules have NO INFLUENCE on SEO, you need to bear in mind that the search engines will have associated the URL with the underlying content in their indexing of the site.

If you now remove this module (to revert to dynamic URL's), then the search engines will show the OLD url's (the ones in their index) and anyone clicking the link will probably get a 404 error (page not found). Too many of these, (all of them in your case) and search engines will drop your site down the rankings faster than a falling meteorite, and possibly relegate it to a secondary index. This is bad news.

The only way around this is to do 301 re-directs, which will be a list of ALL the old "static" url's, pointing to their corresponding new "dynamic" url. This is a time-consuming and tedious process, and someone more knowledgeable than me will have to advise you of how to set all this up (in a .htaccess file).

The other issue is that if the search engines have in their archive, page url's and the underlying content, when they spider your site again they will see the new url's, spider these - only to find what they then think is duplicate content... another penalising characteristic.

You may have a setting in ADMIN >>> CONFIGURATION (look for something that says URL, or SEO URL or URL REWRITE) where there is an on/off switch.

If this exists, you can turn off the module, which should revert the store to core behaviour.

HOWEVER... bear in mind that BEFORE you turn it off, you need to address the 301 re-direct issue...

20 years a Zencart User

17 Jan 2012, 9:35 AM
#8
danmoto avatar

danmoto

New Zenner

Join Date:
Jan 2012
Posts:
5
Plugin Contributions:
0

Re: Href on product pages wrong after moving of page

Thank you so much for your answer! I guess the problem is solved :smile:

The page had a "search engine optimization" tool installed, which re-wrote the URL's.

I switched it off and it appears to work fine now.

I'll do some more testing and come back if there are any new issues.