Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

step by step instruction: SSL for certain pages only


Go to End


3 Posts   1475 Views

Avatar
KimK

Community Member, 7 Posts

6 March 2014 at 7:43pm

Hi there,

I used SS2.4.10 for a shop and now have the problem that I would like to get only the login and checkout pages SSL secured.

I tried different suggestions in various forums
(http://www.silverstripe.org/general-questions/show/16896,
http://www.silverstripe.org/general-questions/show/13814 (unfortunately the documentation mentioned is not available anymore),
http://snipplr.com/view/27191/ (fatal error),
http://www.silverstripe.org/general-questions/show/13143, and
http://www.silverstripe.org/general-questions/show/14170)

I even called my host to ask if they have installed the php-xml extention which was suggested in one thread.

As it is my first time to use SSL I asked the hosting support where to upload my files as I assumed I have to upload them into httpsdocs, but they asked me to upload them only into httpdocs.
Can this be right? (If not, do I have to upload all files into this directory?)

Now, I simply have no idea how to get this SSL working on these two pages.

Is there anybody who can give me a step by step instruction how to get this done?

or

Any hints why the above forum links didn't help me???

Any help is really appreciated!

Avatar
swaiba

Forum Moderator, 1899 Posts

8 March 2014 at 3:41am

Without reading the above the method I use is in the Page::init() to check for certain URL patterns (or page classes) and if they match then I force the redirection to https at that point. Works for me for many years and is very simple.

Avatar
KimK

Community Member, 7 Posts

8 March 2014 at 1:17pm

Edited: 08/03/2014 1:18pm

Hi swaiba,

thank you for that. How do you force it? Do you use Director::forceSSL(); ?

I tried this, but I get a "404 Not found The requested URL /checkout/checkoutstep/orderformaddress/ was not found on this server."

Does that mean I have to upload the files to the httpsdocs? Or what could be the reason for this?