Jump to content
globi

Back-End on SSL Connection Only

Recommended Posts

Hallo!

I'd like to force SSL (port 443) for the back-end (./processwire/) and prevent the users from loging to the back-end using non-encrypted connection.
What seems to be the best way to achieve it?


Best regards,
Mick

Share this post


Link to post
Share on other sites

Does it have to just be the backend? I don't think there's any harm in setting the whole site to SSL if you want to be on the safe side.

Share this post


Link to post
Share on other sites

If your admin is located at /processwire/ it looks like the easiest thing to do is edit your .htaccess file and add this solution to it  after RewriteEngine On:
 http://stackoverflow.com/questions/9642877/redirect-only-one-folder-to-https-all-others-to-http

Remember to leave the RewriteEngine On line off the example (don't want it in the .htaccess file twice) and change secure to processwire from the example.

Should work but I've not tested it.

Share this post


Link to post
Share on other sites

Templates -> Filters -> Show System Templates : look for "admin" template. Edit and go to -> "URLs" and look for https etc.

  • Like 7

Share this post


Link to post
Share on other sites

A great answer from Soma. However, here's a further question around this topic ...

I quite often take a backup of the server DB and install it locally when I want to work on the site. Generally, the data is more up to date on the server than on my local copy.

If I install the backup from the server, I have no SSL certificate locally and I cannot get into the Admin section.

Any suggestions as to how to get around this?

Thanks.

Share this post


Link to post
Share on other sites

One option is to install a self-signed SSL Certificate on your local machine.   There are numerous instructions on how to do this on the Internet.

I have referenced one that applies to Windows users to get you started.

http://www.howtogeek.com/107415/it-how-to-create-a-self-signed-security-ssl-certificate-and-deploy-it-to-client-machines/

  • Like 5

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Peter Knight
      Hi all
      My .htaccess file is correctly redirecting all requests to
      https:// www. That's great until I want to work locally.
      I thought I had seen a blog post by Ryan where there was a new config setting to ignore both of these if working from localhost?
      I can't find it now so wondering if I was imagining 😕
       
       
    • By Kiwi Chris
      I don't really have anything public to show, as nearly all the work is back-end, but I thought I'd post here anyway as it's a pretty good example of just how powerful Processwire can be.
      About a year ago, I inherited an incomplete Craft website made by a designer. Apart from the usual company information site, it was supposed to provide a customer portal for clients of a wine bottling company to make bookings for production runs.
      Data for stock levels of goods like bottles and labels was to come from an inventory management system Unleashed https://www.unleashedsoftware.com/
      Unleashed provides a REST API, so I had to integrate with that first by writing an API integration module, and then ended up using Processwire's core lazy cron module to periodically pull data from Unleashed using a custom module.
      The booking forms have a lot of conditional fields, eg if you are bottling a given wine variety, you should only be able to select labels that match that variety. All this conditional stuff was achieved with a lot of additions to ready.php.
      I also needed to be able to created a predefined set of pages when a new user is added if they have a 'client' role. Once again, more hooking in ready.php
      I've used the Admin Restrict Branch module so clients can only see their own records when they're logged in, but staff can see all records.
      Lister Pro provides the ability to search and view completed production runs.
      Part way through the project, as the client was happy with the way things were going, I was asked to add in logistics and dispatch which is provided by another company, which also runs Unleashed with a separate set of data, and with some clients who don't bottle wine, but will end up using the same portal, so using the roles and permissions inherent in Processwire, I set up production templates with separate roles to dispatch templates, so I could easily have clients assigned access to just the templates they need.
      Tracey Debugger got a thorough workout along the way, and the debugger console is an absolute killer tool for making quick changes to data when updating a live site to match changes from the dev site.
      At the start of this project, I'd used Processwire quite a bit, but never dived into module development or hooking, but I've now ended up with a reasonable idea how they work.
      @bernhard has produced some excellent tutorials which I found really helpful figuring out how to create modules, and other people like @Robin S have answered questions when I've got stuck. @ryan himself has been helpful when I've been trying to do things that push either the limits of my knowledge or Processwire or both 😋  .
      Could I have done this with other tools? Depends. Wordpress would have been as useless as using petrol to fight a fire, however something like ASP.Net COULD have done the job but would have probably made things a lot more complicated. In parallel, I've been working on building a REST API with ASP.Net for another client to integrate with an existing SQL Server database, and I've found that Visual Studio is inclined to break projects quite regularly, with dependencies getting messed up, or even whole configuration files getting corrupted when it has a hissy fit, so working with Processwire is a pleasure in comparison.
       
    • By Marco Angeli
      Hi there,
      I added a ssl certificate to my site and I'd like to redirect every single http url to its new https version
      So I added this code in the .htacces file, after the RewriteEngine On :
      Redirect 301 /about https://www.mysite.it/about
      Unfortunately this is now working: I get the "too many redirects" error.
      The following code works, but it's a bulk redirection to the home page, something I don't want for SEO reasons (https://moz.com/blog/save-your-website-with-redirects😞
      RewriteCond %{HTTP_HOST} mysite\.it [NC]
      RewriteCond %{SERVER_PORT} 80
      RewriteRule ^(.*)$ https://www.mysite.it/$1 [R,L]
      Any suggestions?
    • By cosmicsafari
      Hi all,
      Just a quick question, when using the multisite module is there anything different that needs to be done in order to setup HTTPS for each of the domains its serving?
      Would a single SSL certificate for the main domain be enough to cover the others aswell or would you need multiple ceritficates one for each domain the mutlisite setup uses?
       
×
×
  • Create New...