Jump to content

Force NON-ssl connections via htaccess?


jds43
 Share

Recommended Posts

PW already has a mechanism built in that should handle this for you. Edit your templates and look for the URL tab. In the "Scheme/protocol" section choose "HTTP only" and save the change. Repeat for all your templates and you should be set.

Hope that helps.

Link to comment
Share on other sites

Thanks, but this feature doesn't appear to kick in in time to prevent my server from attempting to load the SSL certificate. I believe I need an .htaccess solution which will redirect the URL BEFORE ProcessWire is called.

Link to comment
Share on other sites

In the processwire htaccess look for these lines

  # -----------------------------------------------------------------------------------------------
  # If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below.
  # -----------------------------------------------------------------------------------------------
  # RewriteCond %{HTTPS} off
  # RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]

and just add yours after those, as this must certainly be the right place to put those redirections

  # -----------------------------------------------------------------------------------------------
  # If you only want to allow HTTP
  # -----------------------------------------------------------------------------------------------
  RewriteCond %{HTTPS} on
  RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L]
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...