I'm trying to redirect all webpages to https for my wordpress app which is hosted on heroku. I'm using the Wordpress HTTPS plugin, and I've succeeded in getting all the wordpress pages to redirect to https, but my custom pages do not redirect. The app is setup using this template. It seems like people traditionally do this by editing the .htaccess file (for example here), but I can't seem to get that to work. I also tried adding '/' to the HTTPS plugin URL filters, but this didn't work either. All my attempts to add php code to the actual page just ends up in an infinite redirect.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Looks like the thing that was getting me was the order in htaccess. Everything works now and my file looks like this
It was important to put the https rule first, which I hadn't done originally.
This should work:
This checks to see if
https
is not on (so if it is off) then redirect the request tohttps