The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

https for some route

herman's Avatar

herman

14 May, 2015 04:53 PM

Hello All,

How to implement Https in Slim but just for some route ?
for example: i only use https for page: login, register. for another page will use http, will it work use hook "slim.before.router" ?

  1. 1 Posted by l@rry on 15 May, 2015 04:25 PM

    l@rry's Avatar

    You could always just get the webserver to do this for you. apache:

    RewriteEngine on
    RewriteCond %{HTTPS} !=on
    RewriteRule ^login\.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  2. 2 Posted by herman on 15 May, 2015 10:30 PM

    herman's Avatar

    ok, thank you. there's no way with slim ?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac