The shop version is osCommerce Online Merchant v2.2 RC2a
. If a user surfes in the shop, the URL has a double slash before index.php. I looked in the config but cannot find an error.
My configure.php in includes folder:
define('HTTP_SERVER', 'http://www.shop.com');
define('HTTPS_SERVER', 'http://www.shop.com');
define('ENABLE_SSL', false);
define('HTTP_COOKIE_DOMAIN', 'www.shop.com');
define('HTTPS_COOKIE_DOMAIN', 'www.shop.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_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', '/home/shop/www/home/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
My configure.php in admin/includes folder:
define('HTTP_SERVER', 'http://www.shop.com');
define('HTTP_CATALOG_SERVER', 'http://www.shop.com');
define('HTTPS_CATALOG_SERVER', 'http://www.shop.com');
define('ENABLE_SSL_CATALOG', 'false');
define('DIR_FS_DOCUMENT_ROOT', '/home/shop/www/home/');
define('DIR_WS_ADMIN', '/admin/');
define('DIR_FS_ADMIN', '/home/shop/www/home/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_FS_CATALOG', '/home/shop/www/home/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
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', DIR_WS_CATALOG . 'includes/languages/');
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_BACKUP', DIR_FS_ADMIN . 'backups/');
On the server the folder catalog
is empty. Therefore DIR_WS_CATALOG
is set to /
.
I also looked in filenames.php for FILENAME_DEFAULT
. I also have search-engine safe urls set to false. I don’t know where the slash is coming from.
2
Answers
This is quite a common issue mostly caused by defining HTTP_SERVER constant of includes/configure.php with trailing slash. So if you still have this issue please first make sure that the website in your browser is not cached and the configure.php file is actually written at your server (permissions issue).
If the problem still exists it will make sense to go through OSC URL generation process step by step. (We are assuming that you are using default OSC URL format.)
By default all URLs in OSC are generated by tep_href_link() function which is located in includes/functions/html_output.php. The function is quite simple. It takes HTTP_SERVER constant and concatenate it with DIR_WS_HTTP_CATALOG. Then $page parameter is added. And even there’s no place where additional slash can be added there you can try adding a debugging code in order to find the source of your issue.
I had to edit these two lines:
they were