Jump to content

Recommended Posts

Posted

I'm trying to append ProcessWire's default htaccess file to redirect all SSL requests to a NON-SSL version of the requested page.

This should work, but it doesn't:

RewriteEngine On

RewriteCond %{HTTPS} on

RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

 

​Could PW be overriding it?

Posted

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.

Posted

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.

Posted

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

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
  • Recently Browsing   0 members

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