0

I've got a strange problem with https not redirecting to http. I need https://indudlgeinbrighton.co.uk to redirect to http://indulgeinbrighton.co.uk It's on a shared server and I'm getting a strange cross over with the https. When https is put in, it's loading information for a completely different website hosted on the server.

https://indulgeinbrighton.co.uk is the URL affected. I don't normally share the URLs I'm working on, but in the case I think it might be helpful to see what's going on. Where it's showing data for a website called Churchill, obviously this is a bit of a problem. I've tried putting in all the solutions provided on this page How do you redirect HTTPS to HTTP? into the root .htaccess but it's not working. The htaccess is working fine, because when I switched it to load the other way from http to https it worked fine.

I can only assume it's reading the htaccess file from the other site when it's looking at the https version. As I know which site it is, that's easy enough to locate, but what could I put in that htaccess file to redirect this particular url query without affecting https redirects on the other site?

Thank you.

Community
  • 1
  • 1
GibsonFX
  • 1,000
  • 2
  • 10
  • 33

2 Answers2

1

try this in your .htaccess

RewriteEngine On 
RewriteCond %{SERVER_PORT} 443 
RewriteRule ^(.*)$ http://indulgeinbrighton.co.uk/$1 [R,L]
Mauro Sala
  • 1,166
  • 2
  • 12
  • 33
  • Exellent that did the trick, but it needed to be added to the .htaccess file of the churchillbrighton.com directorty, not it's own. Thank you for your help. Saved me a big headache. – GibsonFX Dec 29 '15 at 07:08
  • 1
    Hi, just wondering if you knew how to make this work for all pages of the site? This only seems to have fixed the home page? Thanks agan – GibsonFX Dec 31 '15 at 03:00
0

this is for security measure

The page at 'https://indulgeinbrighton.co.uk/' was loaded over HTTPS, but requested an insecure script 'http://churchillbrighton.com/wp-content/themes/brighton-hotels/js/avia.js?ver=3'. This request has been blocked; the content must be served over HTTPS.

you can try to do this in PHP

$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';

or include always external files in https

Mauro Sala
  • 1,166
  • 2
  • 12
  • 33
  • sorry, variable $protocol must be placed before every exteneral file like this – Mauro Sala Dec 29 '15 at 06:52
  • Sorry not sure I follow what you're trying to get me to do. I don't want to load the https, or any content from churchill. I want the https:// induldgeinbrighton.co.uk to redirect to http:// indulgeinbrighton.co.uk – GibsonFX Dec 29 '15 at 06:54