Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 704 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to disable secure pages on a local server?

#1
I've just moved a Drupal to my localserver and I forgot to disable Secure Pages.

Now I cannot access admin pages, because the site switches to HTTPS.

How can I disable it?
Reply

#2
You can disable the module directly via the database. Just go into the `system` table, look for your module under the `name` column, and set the `status` field to zero.
Reply

#3
The way I've done it without disabling the module is to use SQL to change the variable setting. First backup your database (in case you put a semicolon in the wrong place; scratch that, **always** back up your database before making changes on the command line) and then run the following SQL on your database:

UPDATE variable SET value = 's:1:"0";' WHERE name = 'securepages_enable';

Then:

DELETE FROM cache;
DELETE FROM cache_page;

You need those two lines in order to clear the cache, otherwise the variable might stick around for a while.
Reply

#4
In your settings.php file:

`$conf['securepages_enable'] = FALSE;`

This will override the database setting.

In your `sites/example.com/settings.php`, leave this line out, and then it will use whatever value is in the database.
Reply

#5
If you are using drush, you can keep the Secure Pages module enabled and just turn off the checkbox in the module's own config like:

drush vset securepages_enable 0

This will stop the redirect.

you can also change the URLs if you want, as follows, but the above is usually enough.

drush vset securepages_basepath

[To see links please register here]

drush vset securepages_basepath_ssl

[To see links please register here]


I'm running Drupal 7 btw, so YMMV, but seems to be a simple drush based solution following on from the above answer.
Reply

#6
If you have Drush installed:

drush dis -y securepages
Reply

#7
I know this question is old and has been answered a few times, but there's another option that hasn't been suggested yet.

You could disable it completely:

// Disable SecurePages completely.
$conf['securepages_enable'] = FALSE;

and alter settings.php to enforce HTTPS depending on some context, e.g.:

if (isset($_SERVER['environment'] && $_SERVER['environment'] == 'staging')) {
$conf['securepages_basepath'] = 'http://staging.example.com';
$conf['securepages_basepath_ssl'] = 'https://staging.example.com';
} else if (isset($_SERVER['environment'] && $_SERVER['environment'] == 'production')) {
$conf['securepages_basepath'] = 'http://www.example.com';
$conf['securepages_basepath_ssl'] = 'https://www.example.com';
} else {
// We're on dev or some other server instance where SSL isn't needed.
$conf['securepages_enable'] = FALSE;
}

This is just an example, but it's been a helpful way for us to manage sites that exist on a dev server, a QA server, and a production server, where we want to track settings.php changes in version control without having to change things in each environment.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through