Tom Posted October 3, 2014 Share Posted October 3, 2014 Hi, i would like to use for my Processwire project a secure https connection instead of a regular http connection. For this reason i installed a valid ssl certificate and added a new htaccess rule and condition to my htaccess file: RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.tld/$1 [R,L] Now, when i try to access the page via „http://domain.tld/application/xyz“ i get redirected to „https://domain.tld/?it=application/xyz“. Does anyone know how the rule must be adjusted so that the rewriting is still working correctly? The problem only appears if the user comes from a http url. Thanks Tom Link to comment Share on other sites More sharing options...
horst Posted October 3, 2014 Share Posted October 3, 2014 Maybe this is usefull link: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS 1 Link to comment Share on other sites More sharing options...
netcarver Posted October 3, 2014 Share Posted October 3, 2014 Actually, you can do this from within PW itself without resorting to htaccess rewrites (if you want to.) Edit your templates and look at the URLs tab. There is a section there where you can define which scheme the page should be served as. Switch over each template representing pages that you need served via https and save them. Your pages should now be directly accessible via the https scheme and if you try to access them via http you should be redirected to https. 3 Link to comment Share on other sites More sharing options...
Tom Posted October 3, 2014 Author Share Posted October 3, 2014 Well, I have somehow forgotten that you could control this by using the template. My mistake. Nevertheless, many thanks for the quick help! Link to comment Share on other sites More sharing options...
netcarver Posted October 3, 2014 Share Posted October 3, 2014 @Tom, I just tried this on my https site and the automatic PW redirect doesn't seem to be working so I've opened an issue on github for the problem. In the meantime, you could try this in the top of your template files... if (!$config->https) { $session->redirect($your_https_landing_url); } Just build the landing url as you want or use the current url and substitute the https scheme. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now