1. Modify the admin.php file name, modify the jump address and write the complete path. The specific modifications are as follows:
<?php header('location:index.php?m=admin'); ?>
Replace the "index" in the code .php?m=admin" to a specific URL, such as: https://www.php.cn/myadmin/index.php.
2. Modify /phpcms/modules/admin/index.php and change the public function login to the address you want:
Find "?m=admin&c=index&a=login" to proceed Bulk replacement.
3. Modify /phpcms/modules/admin/classes/admin.class.php
3.1 Modify the following code:
final public function check_admin() { if(ROUTE_M =='admin' && ROUTE_C =='index' && in_array(ROUTE_A, array('login', 'public_card'))) {
to:
final public function check_admin() { if(ROUTE_M =='admin' && ROUTE_C =='index' && in_array(ROUTE_A, array('新登录函数名', 'public_card'))) {
3.2 Modify the code
if(!isset($_SESSION['userid']) || !isset($_SESSION['roleid']) || !$_SESSION['userid'] || !$_SESSION['roleid']) showmessage(L('admin_login'),'m=admin&c=index&a=login');
to
if(!isset($_SESSION['userid']) || !isset($_SESSION['roleid']) || !$_SESSION['userid'] || !$_SESSION['roleid']) showmessage(L('admin_login'),APP_PATH);
Note: This modification will avoid jumping to the homepage of the website, because you will never be able to type without knowing the exact address. Open the login page.
3.3 Change the code
final public function check_priv() { if(ROUTE_M =='admin' && ROUTE_C =='index' && in_array(ROUTE_A, array('login', 'init', 'public_card'))) return true;
to
final public function check_priv() { if(ROUTE_M =='admin' && ROUTE_C =='index' && in_array(ROUTE_A, array('新登录函数名', 'init', 'public_card'))) return true;
4. Modify /phpcms/modules/admin/templates/login.tpl.php
and change the code
<form action="index.php?m=admin&c=index&a=login&dosubmit=1" method="post" name="myform">
is modified to:
<form action="index.php?m=admin&c=index&a=新登录函数名&dosubmit=1" method="post" name="myform">
5. Search all files under /phpcms/modules/admin and change a=login to a=new login function name.
In this way, the default background address of phpcms v9 can be modified, such as https://www.php.cn/myadmin/index.php (myadmin/index.php is the modified file name).
Related recommendations: phpcms tutorial
The above is the detailed content of How to reset the backend URL in phpcms. 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

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

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.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

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),
