Community Documentation

v3 Knowledgebase

Custom Additional Secure Pages

DESCRIPTION: The following details will allow you to setup a Plugin in PHPFox where you can add any specific pages you want on your site to the limited secure pages listing. This will allow for you to have only specific pages set to HTTPS while leaving most of your site under standard HTTP for the best of performance and security.

TESTED VERSION: 3.6.0 (Build 6)

REQUIREMENTS: You will need to have a couple of items in place for this to work properly on your site:

1) Have a valid SSL Certificate setup for your domain. This tutorial assumes you have taken this step already and does not cover this process. For more details contact your host.

2) Go to AdminCP -> Settings -> System Settings -> Manage Settings -> Module Settings -> Core

3) Set Enable HTTPS Support to True

4) Set Secure Pages with HTTPS to True

CAUTIONARY NOTES: It is not suggested to add the core.index-visitor to the listing as it causes this to display on your URL in the address bar on your homepage, as well as some other undesired effects (from my own experience). I have also not tested this with any other pages that those listed in the code provided, so it is suggested that you test carefully if you opt to secure any other pages to ensure their proper function.

CREATE PLUGIN: Now you just need to get the plugin setup to add additional pages outside Login, Registration, Captcha, User Account Settings, and User Privacy Settings for HTTPS coverage. This example shows how to add the Edit Profile and AdminCP areas to the secured pages, but the principle is the same for any other pages (just add them in where I have the other items):

1) Go to AdminCP -> Extensions -> Plugin -> Create New Plugin

2) Set Product to Core

3) Set Module to Core

4) Set Title to Secure Pages (or whatever you prefer)

5) Set Hook to service -> Core -> core.service_core_getsecurepages

6) Set Active to Yes

7) Set PHP Code to:

$aSecurePages = array_merge($aSecurePages, array('user.profile', 'admincp'));

8) Select Save


You can change or add other pages to the listing in the second array where I have listed 'user.profile', 'admincp' in the above code with the designation of any other pages in the script.