Post by Nordikota » Sat Jun 05, 2021 12:38 am

OC3.0.3.2 running Journal3.

I'm trying to set-up a multi site. It's not working and I can't see what I've done wrong :-\

Main site is 'nordikota', and OC is installed in the default directory.
Trying to set-up another called 'teesquad'
Created a sub-domain called teesquad.nordikota.co.uk. Document root is '/public_html'
In Admin, created a new default user for the new site
Under settings, added a new site called TeeSquad and used the URLs of https://teesquad.nordikota.co.uk
Filled all the rest of the info in.

When I go to teesquad.nordikota.co.uk, I get the main site and it shows nordikota.co.uk in the address bar. There are no re-directs in place.

I can't get past this bit & can't see what I've set-up wrong.

Any ideas?
Last edited by Nordikota on Tue Jun 08, 2021 3:00 am, edited 1 time in total.

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by ADD Creative » Sat Jun 05, 2021 1:56 am

There is a redirect in place. Your subdomain returns a 302 status pointing to your main domain. You need to check your hosting settings or your htaccess. Also check done of your extension or theme adds that sort of thing.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Sat Jun 05, 2021 2:06 am

Journal is not supported on the forum.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Nordikota » Sat Jun 05, 2021 2:40 am

I know. It's not a Journal issue. For the 2nd site I've selected the standard OC theme. But it's still showing the main site.

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by Nordikota » Sat Jun 05, 2021 2:54 am

ADD Creative wrote:
Sat Jun 05, 2021 1:56 am
There is a redirect in place. Your subdomain returns a 302 status pointing to your main domain. You need to check your hosting settings or your htaccess. Also check done of your extension or theme adds that sort of thing.
You are right. There was a re-direct in the HTaccess file to force HTTPS. That's now removed, but still have the same problem. It still looks like it is redirecting..

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by Nordikota » Sat Jun 05, 2021 3:07 am

If I changed the sub domain root to be any other directory, I get a 404 error. If I set it to be public_html (where the base OC files are), then I see the main site and not the sub site.

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by ADD Creative » Sat Jun 05, 2021 5:42 am

Your static files don't redirect, which suggests the issues is caused be an extension or a theme. Selecting the default theme for the second site would not rule out the problem being with your theme. The Journal theme will probably make many changes to core features.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Nordikota » Sat Jun 05, 2021 2:10 pm

I've just found this code in the config.php file. I've removed it and now it seems to work. I've no idea where this came from as it's not standard code. Anyone an idea on what it is for?

Code: Select all

// Redirect users to the OpenCart installation url preventing cross-origin resource sharing policy errors.
if (strtolower($_SERVER['REQUEST_METHOD']) === 'get') {
$https = false;
if (isset($_SERVER['HTTPS']) && (($_SERVER['HTTPS'] == 'on') || ($_SERVER['HTTPS'] == '1'))) {
$https = true;
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
$https = true;
}
$current_url = parse_url(($https ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
$correct_url = parse_url($https ? HTTPS_SERVER : HTTP_SERVER);
if ($current_url !== $correct_url) {
if (dirname($_SERVER['PHP_SELF']) !== '/') {
$url = str_replace(dirname($_SERVER['PHP_SELF']), '', $_SERVER['REQUEST_URI']);
} else {
$url = $_SERVER['REQUEST_URI'];
}
$url = ($https ? HTTPS_SERVER : HTTP_SERVER) . ltrim($url, '/');
if (!headers_sent()) {
header('Location: ' . $url);
} else {
echo '<script>location = "' . $url . '";</script>';
}
exit;
}
}
?>

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by ADD Creative » Sun Jun 06, 2021 3:09 am

Just looks like a redirect to your main domain. Why whoever did it put config.php is anyone's guess.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Nordikota » Sun Jun 06, 2021 4:10 am

So it's still not working. I've found & removed a redirect in the htaccess file, and another one in the config file. I've change the main site to use the default OC theme and the 2nd site is still redirecting to the main site, so it can't be related to Journal. Any suggestions on where else to look?

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by ADD Creative » Sun Jun 06, 2021 5:54 am

Seems to be OK now. Remember web browsers cache redirects, so you may need to clear you browser.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Nordikota » Sun Jun 06, 2021 7:33 pm

It's still redirecting for me. I've cleared the browser cache, tried different browsers and 2 other machines. So it can't be that :-\

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by straightlight » Sun Jun 06, 2021 8:19 pm

Nordikota wrote:
Sun Jun 06, 2021 7:33 pm
It's still redirecting for me. I've cleared the browser cache, tried different browsers and 2 other machines. So it can't be that :-\
Clear your DNS cache in your console and restart all stations, including mobile.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Nordikota » Mon Jun 07, 2021 4:49 pm

Still redirecting :-\

Cleared the OC caches, cleared/refreshed the Modifications cache, and cleared the browser cache on 3 machines. rebooted all 3.

Still the same problem :-\

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by ADD Creative » Mon Jun 07, 2021 5:15 pm

Nordikota wrote:
Mon Jun 07, 2021 4:49 pm
Still redirecting :-\

Cleared the OC caches, cleared/refreshed the Modifications cache, and cleared the browser cache on 3 machines. rebooted all 3.

Still the same problem :-\
Maybe you have a conditional redirect or it's you ISP, because it's not redirecting for everyone. Use a online redirect tester or a VPN service to test.

Even Google Page Speed tester will give you a preview.
https://developers.google.com/speed/pag ... a.co.uk%2F

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ADD Creative » Mon Jun 07, 2021 5:18 pm

Nordikota wrote:
Mon Jun 07, 2021 4:49 pm
Still redirecting :-\

Cleared the OC caches, cleared/refreshed the Modifications cache, and cleared the browser cache on 3 machines. rebooted all 3.

Still the same problem :-\
Are you using https or just http to test. Could be a difference there.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Nordikota » Mon Jun 07, 2021 6:32 pm

I'm only looking at HTTPS, but have tried HTTP/S and they both redirect. Strange as I can see the preview on the Page Insights page as you describe, but I simply can't get that here. We've just moved to a new host and they have looked at the site and can't find any trace of redirects.

Can't think of what else to do ???

Active Member

Posts

Joined
Tue Feb 11, 2014 8:04 pm

Post by straightlight » Mon Jun 07, 2021 6:43 pm

Nordikota wrote:
Mon Jun 07, 2021 6:32 pm
I'm only looking at HTTPS, but have tried HTTP/S and they both redirect. Strange as I can see the preview on the Page Insights page as you describe, but I simply can't get that here. We've just moved to a new host and they have looked at the site and can't find any trace of redirects.

Can't think of what else to do ???
Could be an IGMP packet issue stuck through your outbound network where it could cause a redirect to fail. Restart your modem, either from console, or by unplugging your power cable for 10 secs and re-plug it back. Meanwhile, restart all your stations while the modem recycles its power and service lights. However, there are modems that won't specifically allow to unplug your power cable to restart your internet service. This claim can be verified with your ISP's technical support lines.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Mon Jun 07, 2021 6:53 pm

Nordikota wrote:
Sat Jun 05, 2021 12:38 am
I can't get past this bit & can't see what I've set-up wrong.
If you don't get a solution here, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by ADD Creative » Mon Jun 07, 2021 7:12 pm

Nordikota wrote:
Mon Jun 07, 2021 6:32 pm
I'm only looking at HTTPS, but have tried HTTP/S and they both redirect. Strange as I can see the preview on the Page Insights page as you describe, but I simply can't get that here. We've just moved to a new host and they have looked at the site and can't find any trace of redirects.

Can't think of what else to do ???
You have set the header "strict-transport-security max-age=300; includeSubDomains; preload" but are not redirecting in the correct way.
https://hstspreload.org/?domain=nordikota.co.uk

This could be partly the cause of your issue, so remove it and sort you redirects first.

You will need something like the following in you htaccess.

Code: Select all

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ https://example.com/$1 [E=HTTPS,R=301,L]

RewriteCond %{HTTP_HOST} ^www\.sub\.example\.com$
RewriteRule ^(.*)$ https://sub.example.com/$1 [E=HTTPS,R=301,L]

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 24 guests