加载主目录页

时间:2018-01-09 03:18:46

标签: php .htaccess opencart

我在Opencart ver 1.5.6.4上运行一个ecommence网站,并不像这个网站上的大多数人一样。

我从根目录运行我的实时站点。我已经设置了一个名为“oc2”的子目录,并将我的站点从根目录复制到子目录。我这样做是为了在将新模板转移到生产站点之前对其进行一些测试。大多数事情似乎没问题,但有一些链接仍然指向主站点页面,而不是子目录中的页面。我的问题是,我的.htaccess或配置文件中我做错了什么导致这个?

例如,主站点和子目录中博客的链接如下:

/index.php?route=bossblog/bossblog

在子目录中,我希望这会加载页面:www.example.com/oc2/index.php?route=bossblog/bossblog,但它会加载www.example.com/index.php?route=bossblog / bossblog

我的.htaccess文件如下:

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /oc2/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

/ oc2目录中的配置文件是:

<?php
// HTTP
define('HTTP_SERVER', 'http://www.example.com/oc2/');
define('HTTP_IMAGE', 'http://www.example.com/oc2/image/');
define('HTTP_ADMIN', 'http://www.example.com/oc2/admin/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/oc2/');
define('HTTPS_IMAGE', 'https://www.example.com/oc2/image/');

// DIR
define('DIR_APPLICATION', '/home/pump1080/public_html/oc2/catalog/');
define('DIR_SYSTEM', '/home/pump1080/public_html/oc2/system/');
define('DIR_DATABASE', '/home/pump1080/public_html/oc2/system/database/');
define('DIR_LANGUAGE', '/home/pump1080/public_html/oc2/catalog/language/');
define('DIR_TEMPLATE', '/home/pump1080/public_html/oc2/catalog/view/theme/');
define('DIR_CONFIG', '/home/pump1080/public_html/oc2/system/config/');
define('DIR_IMAGE', '/home/pump1080/public_html/oc2/image/');
define('DIR_CACHE', '/home/pump1080/public_html/oc2/system/cache/');
define('DIR_DOWNLOAD', '/home/pump1080/public_html/oc2/download/');
define('DIR_LOGS', '/home/pump1080/public_html/oc2/system/logs/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'pump1080_xxx');
define('DB_PASSWORD', 'Pumpxxx');
define('DB_DATABASE', 'pump1080_xxx');
define('DB_PREFIX', '');
?>

/ oc2 / admin目录中的配置文件是:

<?php
// HTTP
define('HTTP_SERVER', 'http://www.example.com/oc2/admin/');
define('HTTP_CATALOG', 'http://www.example.com/oc2/');
define('HTTP_IMAGE', 'http://www.example.com/oc2/image/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/oc2/admin/');
define('HTTPS_CATALOG', 'https://www.example.com/oc2/');
define('HTTPS_IMAGE', 'https://www.example.com/oc2/image/');

// DIR
define('DIR_APPLICATION', '/home/pump1080/public_html/oc2/admin/');
define('DIR_SYSTEM', '/home/pump1080/public_html/oc2/system/');
define('DIR_DATABASE', '/home/pump1080/public_html/oc2/system/database/');
define('DIR_LANGUAGE', '/home/pump1080/public_html/oc2/admin/language/');
define('DIR_TEMPLATE', '/home/pump1080/public_html/oc2/admin/view/template/');
define('DIR_CONFIG', '/home/pump1080/public_html/oc2/system/config/');
define('DIR_IMAGE', '/home/pump1080/public_html/oc2/image/');
define('DIR_CACHE', '/home/pump1080/public_html/oc2/system/cache/');
define('DIR_DOWNLOAD', '/home/pump1080/public_html/oc2/download/');
define('DIR_LOGS', '/home/pump1080/public_html/oc2/system/logs/');
define('DIR_CATALOG', '/home/pump1080/public_html/oc2/catalog/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'pump1080_xxx');
define('DB_PASSWORD', 'Pumpxxx');
define('DB_DATABASE', 'pump1080_xxx');
define('DB_PREFIX', '');
?>

对我做错了什么的想法?

谢谢....

0 个答案:

没有答案