How to modify the phpcms management background path
The first step:
Create a folder in the root directory of the website. You will enter the background login interface through this folder in the future, so the folder name must be Choose a name that won’t be easily guessed. As a demonstration here, I will call it admpub. Next, create a new file index.php in this folder with the content:
<?php define('PHPCMS_PATH', realpath(dirname(__FILE__) . '/..') . '/'); include PHPCMS_PATH . '/phpcms/base.php'; // pc_base::creat_app(); $session_storage = 'session_' . pc_base :: load_config('system', 'session_storage'); pc_base :: load_sys_class($session_storage); session_start(); $_SESSION['right_enter'] = 1; unset($session_storage); header('location:../index.php?m=admin');
Step 2:
Create a new file MY_index.php in the phpcms/modules/admin/ folder , the content is:
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class MY_index extends index { public function __construct() { if (empty($_SESSION['right_enter'])) { header('location:./'); exit; } parent :: __construct(); } public function public_logout() { $_SESSION['right_enter'] = 0; parent :: public_logout(); } }
Okay, the modification is completed. In the future, you can only access the backend login portal through the admpub/ directory. If you directly use index.php?m=admin to access it, it will jump directly to the homepage of the website, thus preventing direct access to the backend login portal.
Recommended related articles and tutorials: phpcms tutorial
The above is the detailed content of How to modify the phpcms management background path. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
