Forum Moderators: phranque

Message Too Old, No Replies

How to get rid of https

         

jambam

1:22 pm on Oct 6, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



Currently if you go to the https of my site it just goes to another persons site on the server nothing to do with me.

This seems to be a problem on many many hosts I have used.. https is more of a pain in the butt than anything else in my opinion as it is far to hard for normal average people like me to work out how to properly set it up and unless you are a terroist I really dont see the point of it apart from letting other people accidentally take over the https version of your site with theirs.

Anyway, how can I just turn it off using cpanel so it just eithier 404's or redirects to my http version (the version that I can actually use.)

thank you!

not2easy

3:31 pm on Oct 6, 2016 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Does your domain have an .htaccess file? I would avoid using cpanel settings if possible.

jambam

4:26 pm on Oct 6, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks for your reply. Yes it has htaccess currently the only thing on it at the moment is the standard wordpress code.

not2easy

5:39 pm on Oct 6, 2016 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It sounds like the entire site is within WordPress. If that is the case you should add domain canonicalization rewrite just above the standard WP code. There are many examples of how to do that in this forum, in general (assuming you do use 'www') the code is something like:
#Redirect invalid and non www requests
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Then I would check that your domain has properly set up DNS - look at the domain record at the registrar where your domain is registered.

There are several thousand similar questions in the Apache Forum: [webmasterworld.com...] that can help you learn more about this topic - it is a very common question and well worth the time to understand better. ;)

phranque

9:14 pm on Oct 6, 2016 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you can't fix this with DNS or .htaccess configuration.
your hosting company needs to change the apache configuration so it is listening to the secure port (usually 443) and directs those requests to the appropriate virtual host.

phranque

11:56 pm on Oct 6, 2016 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if you go to the https of my site it just goes to another persons site on the serve


i forgot to mention that this person's site is essentially the default site for https requests for unconfigured hosts - most likely the first virtual host container for a secure port in the apache config file, or perhaps there's an inadvertent wildcard virtual host configured.

jambam

10:48 am on Oct 7, 2016 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks for all your answers. After generating my own automatic ssl and pointing it to my site it made the https version atleast point to my site I then added a piece of code to the htaccess that now redirects https to http:// and everything is working now.