3

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.

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
testing
  • 19,681
  • 50
  • 236
  • 417
  • Are you using Search-Engine Safe URLs? – user487772 Dec 19 '11 at 14:14
  • Also make sure the configuration file from your "local" directory is not loaded as the configuration file above looks absolutely ok. – user487772 Dec 19 '11 at 14:17
  • Do you mean with the `local` directory the directory under `admin/includes/local`, `includes/local`? These directories only contain a README file. – testing Dec 19 '11 at 14:30
  • As I mentioned earlier `Use Search-Engine Safe URLs` is set to false. – testing Dec 19 '11 at 14:34
  • Have you cleared your browser's cache? Those "double slash" links, are they static somewhere inside your template or are they OSC generated? – user487772 Dec 19 '11 at 14:47
  • Yes, I cleared the cache (also tried it with other browsers). They are OSC generated, because no templates are used (I only see that CSS-fluid-1 and fallback CSS are included in the source of index.php). Perhaps the problems occurs, because there is no separate directory for `catalog`. But I tried to use an empty `DIR_WS_CATALOG` parameter without success. – testing Dec 19 '11 at 15:13
  • 1
    The OSC shall work fine in website root and in this case DIR_WS_HTTP_CATALOG have to be set to "/". So in your case everything is set up ok. I really can't imagine what else can be wrong. You may consider trying to debug tep_href_link() function at includes/functions/html_output.php. – user487772 Dec 19 '11 at 15:19
  • Thanks for your help! Finally I figured it out. Because I set the rights to `444` on the configure.php in includes folder he never made the changes with the slashes at the end of `HTTP_SERVER`. I didn't find it out because I chose to use the local file in FileZilla and the local file included the right version ... – testing Dec 20 '11 at 09:44
  • Glad you solved it. I will post a comprehensive answer below so it will help someone else who have this issue. – user487772 Dec 20 '11 at 09:47

2 Answers2

2

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.

user487772
  • 8,800
  • 5
  • 47
  • 72
0

I had to edit these two lines:

  define('DIR_WS_HTTP_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');

they were

  define('DIR_WS_HTTP_CATALOG', '//');
  define('DIR_WS_HTTPS_CATALOG', '//');
ruben
  • 1,745
  • 5
  • 25
  • 47