Post by JLTD » Thu Dec 22, 2016 9:09 pm

Hi, I have an issue with Opencart v2.2.0.0 using https in the admin section breaking all css and button operation.

When I change https to http in the url the page displays fine, but when saving or changing page it reverts back to https and loses the css again. The storefront is absolutely fine and works/displays ok.

Background:
I created a store for a client on their domain, which has an SSL certificate and works perfectly.

The client now wants a second site with the same products and settings as the first site, with different branding and design.

I have created a domain reference on a different server and:
- installed a clean version of opencart 2.2 (same as original site)
- created a new database
- run the install successfully and deleted the install folder
- Everything worked fine
- created a backup of the original site with backup pro, turning off SSL in the settings
- uploaded the tgz file to the new domain reference and unpacked it.
- The duplicate store front worked fine after fix to the seo urls in htaccess
- The admin however was broken, no css and buttons not appearing, just a text list of the admin menu.

Both config files have http throughout (no mention of https anywhere) and htaccess all http.

Once the new site is ready to go live I'll purchase SSL for it, as currently the domain it will become is live with an ssl cert for this domain already, and not yet transferred over to the new host.

HTACCESS SETTINGS:

Code: Select all

# 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 Directory listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On

#RewriteBase /
RewriteBase /mydomain.co.uk/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/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]

#force use of www to enable system images to work
RewriteCond %{HTTP_HOST} ^00.000.00.000/mydomain.co.uk/R=301,NC]
RewriteRule ^(.*)$ http://00.000.00.000/mydomain.co.uk/$1 [L,R=301,NC]

CONFIG:

// HTTP
define('HTTP_SERVER', 'http://00.000.00.000/mydomain.co.uk/');

// HTTPS
define('HTTPS_SERVER', 'http://00.000.00.000/mydomain.co.uk/');

ADMIN CONFIG:
// HTTP
define('HTTP_SERVER', 'http://00.000.00.000/mydomain.co.uk/admin/');
define('HTTP_CATALOG', 'http://00.000.00.000/mydomain.co.uk/');

// HTTPS
define('HTTPS_SERVER', 'http://00.000.00.000/mydomain.co.uk/admin/');
define('HTTPS_CATALOG', 'http://00.000.00.000/mydomain.co.uk/');
Any help on solving this would be greatly appreciated!

Many thanks

John
Last edited by Johnathan on Thu Dec 22, 2016 11:30 pm, edited 1 time in total.
Reason: Added [code] tags for readability

Newbie

Posts

Joined
Thu Dec 22, 2016 8:41 pm

Post by IP_CAM » Fri Dec 23, 2016 9:44 am

I cannot tell you anything about Multi-Store Setting/linking. But it would bee easy for you,
to check in the Browser Page Source, how the STYLESHEET.CSS file is linked, in order
to find out, why you have no CSS Style in the Admin Section.

There is no other way to check on this, since you obviously do not want to 'spare' a valid Site Link (mydomain.co.uk) :-\

Good Luck ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Users browsing this forum: No registered users and 176 guests