search
HomeCMS TutorialPHPCMSHow to change the phpcms background path

How to change the phpcms background path

Jan 15, 2020 pm 05:11 PM
phpcms

How to change the phpcms background path

How to modify the phpcms background path:

Method 1: Change it to a second-level domain name in the management background.

How to change the phpcms background path

##In the management background: Settings > Related Settings > Security Configuration > Backend access domain name, enter the custom second-level domain name admin.cmsyou.com, You can only log in through this domain name (if you need to remove the binding, you need to modify the parameter admin_url in /caches/configs/system.php to manually cancel the binding).

After that, admin.cmsyou.com is resolved to this host in the domain name resolution, and the host is also bound to it. In addition, the default index order index.php is set first, so that the management backend entrance is modified.

Method 2: Determine the management entrance based on the custom SESSION value.

This method requires modifying the default phpcms php file, customizing a portal to start SESSION, and then judging the SESSION. If it matches, log in, if not, jump to the home page. CMSYOU currently uses this method.

1. Modify the \phpcms\modules\admin\index.php file and add at the beginning of the public function __construct() method:

//login diy
if (empty($_SESSION['cms_login'])) {
header('location:'.APP_PATH);
exit;
}

Also find the public function public_logout() method, in the sentence First add the line

$_SESSION['cms_login'] = 0;

. This will clear the cms_login SESSION value after exiting.

2. Then customize a php file to enable the cms_login SESSION value for matching:

Create a new admin\ directory in the root directory of the website, and create a new file index.php in this directory. The content is as follows:

<?php define(&#39;PHPCMS_PATH&#39;, realpath(dirname(__FILE__) . &#39;/..&#39;) . &#39;/&#39;);
include PHPCMS_PATH . &#39;/phpcms/base.php&#39;; // pc_base::creat_app();
$session_storage = &#39;session_&#39; . pc_base :: load_config(&#39;system&#39;, &#39;session_storage&#39;);
pc_base :: load_sys_class($session_storage);
session_start();
$_SESSION[&#39;cms_login&#39;] = 1;
unset($session_storage);
header(&#39;location:../index.php?m=admin&#39;);
?>

PHP Chinese website, a large number of free

PHPCMS tutorials, welcome to learn online!

The above is the detailed content of How to change the phpcms background path. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

MantisBT

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.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment