Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moving the catalog folder


aspiringdeveloper

Recommended Posts

Posted

Hi,

 

Without going into details as to why or how; my oscommerce catalog file is located in a subdirectory of my public directory.

 

Normally the catalog folder should be located at the root public folder such that one can get to the store catalog by using URL:

 

http://www.mydomain.com/catalog

 

On my system, the URL would be:

 

 

http://www.mydomain.com/subfolder/catalog

 

Therefor there is an extra subfolder above the catalog. If I move the catalog folder up the tree to the root none of the store will work.

 

There must be a simple way to move it up to the root and change a setting in the config.php or somewhere else to direct the system. My last resort is to re-install but that seems like overkill.

 

Can someone tell me what settings to change in order to move my catalog folder properly?

 

Thanks

Posted
Hi,

 

Without going into details as to why or how; my oscommerce catalog file is located in a subdirectory of my public directory.

 

Normally the catalog folder should be located at the root public folder such that one can get to the store catalog by using URL:

 

http://www.mydomain.com/catalog

 

On my system, the URL would be:

http://www.mydomain.com/subfolder/catalog

 

Therefor there is an extra subfolder above the catalog. If I move the catalog folder up the tree to the root none of the store will work.

 

There must be a simple way to move it up to the root and change a setting in the config.php or somewhere else to direct the system. My last resort is to re-install but that seems like overkill.

 

Can someone tell me what settings to change in order to move my catalog folder properly?

 

Thanks

 

Once you move the folder you will need to edit

 

catalog/includes/configure.php

 

and

 

catalog/admin/includes/configure.php

 

to show the correct paths to you http and physical folders.

 

You can post them here (WITHOUT DATABASE INFO :NEVER POST DATABASE USERNAMES OR PASSWORDS)

 

and we can post the corrections

 

AGAIN do NOT cut and paste the part including your database username and password.

 

 

~~~Tapuahk

Posted
Once you move the folder you will need to edit

 

catalog/includes/configure.php

 

and

 

catalog/admin/includes/configure.php

 

to show the correct paths to you http and physical folders.

 

You can post them here (WITHOUT DATABASE INFO :NEVER POST DATABASE USERNAMES OR PASSWORDS)

 

and we can post the corrections

 

AGAIN do NOT cut and paste the part including your database username and password.

~~~Tapuahk

 

 

I think I get it. my subfolder is /test/, therefor everywhere /test/ appears I should remove it.

 

From configure.php:

  define('HTTP_SERVER', 'http://www.hydranterouge.com');
 define('HTTPS_SERVER', 'http://www.hydranterouge.com');
 define('ENABLE_SSL', false);
 define('HTTP_COOKIE_DOMAIN', 'www.hydranterouge.com');
 define('HTTPS_COOKIE_DOMAIN', 'www.hydranterouge.com');
 define('HTTP_COOKIE_PATH', '/test/catalog/');
 define('HTTPS_COOKIE_PATH', '/test/catalog/');
 define('DIR_WS_HTTP_CATALOG', '/test/catalog/');
 define('DIR_WS_HTTPS_CATALOG', '/test/catalog/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 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_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/services/webpages/h/y/hydranterouge.com/public/test/catalog/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

similar for the other configure file. Any other changes? thanks

Posted

actually, you could re-install (or just install) a new osc shop at the webroot, then you just over-write all the new installed files (SAVE the two new configure.php!) with the old ones.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Posted
actually, you could re-install (or just install) a new osc shop at the webroot, then you just over-write all the new installed files (SAVE the two new configure.php!) with the old ones.

 

Ken

 

Would'nt it re-write the tables and I risk loosing data? Is oscommerce smart enough to see that the SQL data is intact?

Anyway, I modified the congiure.php files as suggested by tapuack.. Seems to work. Funny that the configure program doesn't use a top level directory name as a variable and then refer to it later down. It seems repetitive. The important thing is it works. Php is great.

Posted
Would'nt it re-write the tables and I risk loosing data? Is oscommerce smart enough to see that the SQL data is intact?

Anyway, I modified the congiure.php files as suggested by tapuack.. Seems to work. Funny that the configure program doesn't use a top level directory name as a variable and then refer to it later down. It seems repetitive. The important thing is it works. Php is great.

 

You mean something like this:

 

  define('URL_STORE','www.hydranterouge.com');
 define('SSL_URL_STORE','www.hydranterouge.com');
 define('CATALOG_PATH','/catalog/');
 define('HTTP_SERVER', 'http://' . URL_STORE);
 define('HTTPS_SERVER', 'https://' . SSL_URL_STORE);
 define('ENABLE_SSL', false);
 define('HTTP_COOKIE_DOMAIN', URL_STORE);
 define('HTTPS_COOKIE_DOMAIN', SSL_URL_STORE);
 define('HTTP_COOKIE_PATH',CATALOG_PATH);
 define('HTTPS_COOKIE_PATH', CATALOG_PATH);
 define('DIR_WS_HTTP_CATALOG', CATALOG_PATH);
 define('DIR_WS_HTTPS_CATALOG', CATALOG_PATH);
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 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_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', $_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH);
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

It saves time on changes.

 

NOTE: the $_SERVER['DOCUMENT_ROOT'] may not work on all systems.

 

Check it using this file call myenv.php

 

<?php
echo 'DOCUMENT ROOT: ' . $_SERVER['DOCUMENT_ROOT'];
echo '<br>DOCUMENT ROOT OLD: ' . $_SERVER['DOCUMENT_ROOT_OLD'];
echo '<br>HTTP HOST: ' . "$HTTP_HOST";
echo '<br>HTTP HOST(get): ' . getenv('HTTP_HOST');
echo '<br>Server Port($serv): ' . $_SERVER['SERVER_PORT'];
echo '<br>SSL Status($serv): ' . $_SERVER['HTTPS'];
echo '<br>Fowarded Server: ' . getenv('HTTP_X_FORWARDED_SERVER');
echo '<br>Fowarded Host: ' . getenv('HTTP_X_FORWARDED_HOST');
echo '<br>Fowarded By: ' . getenv('HTTP_X_FORWARDED_BY');
?>

 

~~~Tapuahk

Posted
You mean something like this:

 

  define('URL_STORE','www.hydranterouge.com');
 define('SSL_URL_STORE','www.hydranterouge.com');
 define('CATALOG_PATH','/catalog/');
 define('HTTP_SERVER', 'http://' . URL_STORE);
 define('HTTPS_SERVER', 'https://' . SSL_URL_STORE);
 define('ENABLE_SSL', false);
 define('HTTP_COOKIE_DOMAIN', URL_STORE);
 define('HTTPS_COOKIE_DOMAIN', SSL_URL_STORE);
 define('HTTP_COOKIE_PATH',CATALOG_PATH);
 define('HTTPS_COOKIE_PATH', CATALOG_PATH);
 define('DIR_WS_HTTP_CATALOG', CATALOG_PATH);
 define('DIR_WS_HTTPS_CATALOG', CATALOG_PATH);
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 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_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', $_SERVER['DOCUMENT_ROOT'] . CATALOG_PATH);
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

It saves time on changes.

 

NOTE: the $_SERVER['DOCUMENT_ROOT'] may not work on all systems.

 

Check it using this file call myenv.php

 

<?php
echo 'DOCUMENT ROOT: ' . $_SERVER['DOCUMENT_ROOT'];
echo '<br>DOCUMENT ROOT OLD: ' . $_SERVER['DOCUMENT_ROOT_OLD'];
echo '<br>HTTP HOST: ' . "$HTTP_HOST";
echo '<br>HTTP HOST(get): ' . getenv('HTTP_HOST');
echo '<br>Server Port($serv): ' . $_SERVER['SERVER_PORT'];
echo '<br>SSL Status($serv): ' . $_SERVER['HTTPS'];
echo '<br>Fowarded Server: ' . getenv('HTTP_X_FORWARDED_SERVER');
echo '<br>Fowarded Host: ' . getenv('HTTP_X_FORWARDED_HOST');
echo '<br>Fowarded By: ' . getenv('HTTP_X_FORWARDED_BY');
?>

 

~~~Tapuahk

 

Yeah that's the smart way to do things. As soon as I start customizing I'm sure I'll have some things to add. :thumbsup:

  • 6 months later...
Posted

Hello,

 

If i was to move my shop from a 'shop' folder to the root what would I change this code too?

 

  define('HTTP_SERVER', 'http://www.mysite.co.uk');
 define('HTTPS_SERVER', 'http://www.mysite.co.uk');
 define('ENABLE_SSL', false);
 define('HTTP_COOKIE_DOMAIN', 'www.mysite.co.uk');
 define('HTTPS_COOKIE_DOMAIN', 'www.mysite.co.uk');
 define('HTTP_COOKIE_PATH', '/shop/');
 define('HTTPS_COOKIE_PATH', '/shop/');
 define('DIR_WS_HTTP_CATALOG', '/shop/');
 define('DIR_WS_HTTPS_CATALOG', '/shop/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 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/');

 

So all it takes is the two configure files to be changed and the site should work fine without loosing any information?

 

Thanx!

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...