Post by Spetre150 » Tue Jan 09, 2018 2:06 am

I am sure this is a simple thing I am missing from spending too much time looking at it.

I am running version 1.5.6.4

I have my live site running from the root directory. I have set up a subdirectory called "oc2" to do some testing on a new template before going live on the production site. Most things appear to be OK, but there are a few links that still point back to the main site, not the subdirectory. My question is, what am I doing wrong in my .htaccess or config files that would cause this?

As an example, in the footer the "About us" link is as follows:
<a href="../index.php?route=information/information&information_id=4">

When a user clicks on the "About us" link the "about us" from the main site gets loaded, not the "about us" from the subdirectory

My .htaccess on the subdirectory is as follows:
# 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
My config file in the /oc2 directory is:
<?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', '');
?>
My config file in the /oc2/admin directory is:
<?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', '');
?>
Any thoughts of what I have done wrong or need to change??

Thanks very much for your insight...

Newbie

Posts

Joined
Thu Apr 03, 2014 1:47 am

Post by IP_CAM » Tue Jan 09, 2018 2:36 am

Well, this linking is not correct, but your config and .htaccess files seem to look ok:

Code: Select all

<a href="../index.php?route=information/information&information_id=4">
as well as other footer links should look like:

Code: Select all

<a href="index.php?route=information/information&information_id=4">
and, by example, in the footer.tpl file, it should look like:

Code: Select all

<li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
to create this kind of Browser Source:

Code: Select all

<li><a href="http://www.ipcam.li/shop/index.php?route=information/information&amp;information_id=6">Delivery Information</a></li>
Do you have another .htaccess file in the Site root section ?
Ernie

For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Spetre150 » Tue Jan 09, 2018 2:58 am

Thanks very much Ernie. I appreciate all the time you take to help others out!

Changing the links in the footer per your guidance.

Wondering if you, or others, might know what is wrong with the links in my menu structure as well? I am using the Megamenu and the url for the blog is listed as:
/index.php?route=bossblog/bossblog
When the user clicks on the menu item they end up at the main blog, not the one on the subdirectory.

Thank you in advance...

Newbie

Posts

Joined
Thu Apr 03, 2014 1:47 am

Post by Spetre150 » Tue Jan 09, 2018 3:00 am

...and in answer to your question, yes, I have another .htaccess in the root directory.

Newbie

Posts

Joined
Thu Apr 03, 2014 1:47 am

Post by IP_CAM » Tue Jan 09, 2018 6:06 am

Well, then remove the root .htaccess, and try again!
Ernie

For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Spetre150 » Tue Jan 09, 2018 6:57 am

Ernie,

I am running my live site on the root. I do not wish to remove the .htaccess file from the root as it would affect my live store. Is there an issue with running both as they are in separate directories? I wish my live store to be running from the root and my test store running from the /oc2 directory.

Any ideas about how to get the links to work from the Megamenu?

Thank you...

Newbie

Posts

Joined
Thu Apr 03, 2014 1:47 am

Post by IP_CAM » Tue Jan 09, 2018 7:05 am

Well, I do not expect this to work, as it should, and it will end up in some
surplus 'rewrite/redirect' Actions, wich probably have some effect on functions.
But I don't think, that your Shop is busy 24 hours a day, so, you could try at least,
it's only a 1 Minute Matter, to find out.
Good Luck :D
Ernie

For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Spetre150 » Tue Jan 09, 2018 7:42 am

When I removed the other .htaccess file from the root, I still get redirected to the live (root) pages from the subdirectory links. Difference being that I get a bunch of error messages as well

For this example, I clicked on the "blog" menu item which I referenced earlier from the /oc2 site, it still loads the blog from the main site instead of the subdirectory, but also get the following errors:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 81

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 82

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 85

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 86

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 87

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 88

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 89

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 90

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 93

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 94

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 95

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 96

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 97

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 98

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 99

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 100

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 101

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 102

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 103

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 104

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 105

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 106

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 107

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 108

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 109

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 110

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php on line 111

Warning: Cannot modify header information - headers already sent by (output started at /home4/pump1080/public_html/oc2/vqmod/vqcache/vq2-system_startup.php:81) in /home4/pump1080/public_html/oc2/system/nitro/core/top.php on line 249
Again, I would think that the menu item link that is on the /oc2 subdirectory which is
/index.php?route=bossblog/bossblog
should redirect to the /oc2 site and load the blog from there, but it does not. It loads the main blog instead.

Thx

Newbie

Posts

Joined
Thu Apr 03, 2014 1:47 am
Who is online

Users browsing this forum: No registered users and 14 guests