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?
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.
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.
Journal is not supported on the forum.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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..ADD Creative wrote: ↑Sat Jun 05, 2021 1:56 amThere 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.
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.
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;
}
}
?>
Just looks like a redirect to your main domain. Why whoever did it put config.php is anyone's guess.
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?
Seems to be OK now. Remember web browsers cache redirects, so you may need to clear you browser.
Clear your DNS cache in your console and restart all stations, including mobile.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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
Are you using https or just http to test. Could be a difference there.
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
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.Nordikota wrote: ↑Mon Jun 07, 2021 6:32 pmI'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
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
You have set the header "strict-transport-security max-age=300; includeSubDomains; preload" but are not redirecting in the correct way.Nordikota wrote: ↑Mon Jun 07, 2021 6:32 pmI'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
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]
Who is online
Users browsing this forum: adycobra2003, awex, Bing [Bot] and 155 guests