0

Is there a way of setting MAMP Pro up to use SSL for specific pages of a CMS site rather than a global site-wide enforcing of SSL.

A SilverStripe site we are working on requires only portions of the site to be secure and so we programmatically enforce this using Director::forceSSL on the specific areas of the site. It works well on the live production site - real host / domain.

When I enable SSL in MAMP Pro on our dev machine it is applied site-wide and I can only access the site with https://mysite.local:8890/. In other words is there a way of having the self-signed certificate in MAMP Pro installed but not used unless (programatically) enforced, without touching the .htaccess file?

Prembo
  • 2,256
  • 2
  • 30
  • 50

1 Answers1

1

I fear this is not possible. Your options might be:

  • htaccess
  • CMS

htaccess
Force HTTPS on certain sites:

# Force HTTPS for /my
RewriteCond %{HTTPS} !=on
RewriteCond %{THE_REQUEST} ^[A-Z]+\s/my [NC]
RewriteRule ^(my) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

CMS
Force HTTPS on certain pages with your CMS.
In your case this could help.

Community
  • 1
  • 1
avarx
  • 509
  • 5
  • 21
  • After some weeks of trying to achieve this I came to the same conclusion. I came to accept that I had to live with https for the whole site in my dev environment. All worked fine the production server (using SilverStripe's forceSSL() for the relevant pages / areas) – Prembo Jan 30 '14 at 08:46