We help IT Professionals succeed at work.

Redirecting https to http when loading site

We would like the FQDN https://www.workforcesoftware.com forwarded to http://www.workforcesoftware.com as we don't currently have an HTTPS based offering of the wordpress site.

We have tried a few things in .htaccess but to no avail. Here is the current .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Options All -indexes

<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresActive on
ExpiresDefault "access plus 30 days"
Header unset ETag
FileETag None
</FilesMatch>

<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</IfModule>


RewriteCond %{HTTP_HOST} ^workforcesoftware\.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www\.workforcesoftware\.ca$
RewriteRule ^/?$ "http\:\/\/www\.workforcesoftware\.com\/canada\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^workforcesoftwarellc\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.workforcesoftwarellc\.co\.uk$
RewriteRule ^/?$ "http\:\/\/workforcesoftware\.com\/united\-kingdom" [R=301,L]


RewriteCond %{HTTP_HOST} ^workforcesoftware\.com\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.workforcesoftware\.com\.au$
RewriteRule ^/?$ "http\:\/\/wfsaustralia\.com" [R=301,L]

Open in new window


As of right now, it prompts for a security error and then shows the default cPanel error page:

2015-03-20-08-50-42-Default-Web-Site-Pag
Comment
Watch Question

It's not a WordPress problem, but a cPanel one.

cPanel doesn't refuse to serve the https:// version of your site, just because you don't have an SSL cert.  Try your https:// URL again in an Incognito window or on a PC that hasn't been there before - you get a different warning first to say that the SSL cert presented is in the name of your webhosting company (webserversystems.com) and not your domain.

I don't think there's anything you can do about it.  The cPanel warning you see if you click to ignore the warning from your browser is coming from the cPanel server, not your account - so you can't redirect it yourself.

An SSL cert is under $10 so you could get one if your problem is that people are linking to your URL using https, but otherwise, just forget about it
Marketing Technologist
Commented:
htaccess rule to redirect https prepended urls to http:

RewriteCond %{SERVER_PORT} 443
RewriteRule ^(.*)$ http://www.workforcesoftware.com/$1 [R,L]

Open in new window

Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You can Not redirect an HTTPS connection to HTTP without having an SSL/TLS certificate.  Why?  Because the HTTPS connection is negotiated Before anything else is done.  No certificate = No connection = No Redirect.

Author

Commented:
We have our wildcard certificate loaded within cPanel, but it is redirecting to the cpanel host and showing invalid certificate for that host (not our server, just the node).