OsCommerce 商店中的双斜线(例如 http://www.shop.com//index.php?cPath=427)
商店版本为osCommerce Online Merchant v2.2 RC2a
。如果用户在商店中浏览,则该 URL 在 index.php 之前有一个双斜杠。我查看了配置但找不到错误。
我的configure.php 在includes 文件夹中:
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/');
我的configure.php 在admin/includes 文件夹中:
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/');
在服务器上,文件夹catalog
是空的。因此,DIR_WS_CATALOG
设置为 /
。
我还在 filenames.php 中查找了 FILENAME_DEFAULT
。我还将搜索引擎安全网址设置为 false。我不知道斜线从哪里来。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个相当常见的问题,主要是由于在 include/configure.php 中定义带有尾部斜杠的 HTTP_SERVER 常量引起的。因此,如果您仍然遇到此问题,请首先确保您的浏览器中的网站没有被缓存,并且configure.php文件实际上是在您的服务器上写入的(权限问题)。
如果问题仍然存在,则逐步执行 OSC URL 生成过程是有意义的。 (我们假设您使用默认的 OSC URL 格式。)
默认情况下,OSC 中的所有 URL 均由位于includes/functions/html_output.php 中的tep_href_link() 函数生成。该功能非常简单。它采用 HTTP_SERVER 常量并将其与 DIR_WS_HTTP_CATALOG 连接起来。然后添加 $page 参数。即使没有地方可以添加额外的斜杠,您也可以尝试添加调试代码以找到问题的根源。
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