Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of modifying phpcms background path

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to modify the background path of phpcms. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

How to modify the phpcms backend path:

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

Access the domain name at the management backend: settings-> related Settings-> Security configuration-> background access domain name. After entering the custom secondary domain name admin.cmsyou.com, you can only log in through this domain name (if you need to unbind, you need to modify the parameter admin_url in / caches/configs/system.php and unbind it manually).

After resolving admin.cmsyou.com to this host in domain name resolution, the host side is also bound, and the default index order index.php is set to be the first, so as to manage the modification of the background entry.

Method 2: judge the management entry according to the custom session value.

This method needs to modify the default php file of phpcms, customize an entry to start SESSION, then judge SESSION, log in if it matches, or jump to the home page if not. This method is currently used by CMSYOU.

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

/ / login diyif (empty ($_ SESSION ['cms_login'])) {header (' location:'.APP_PATH); exit;}

In addition, find the public function public_logout () method and add it at the beginning of the sentence

$_ SESSION ['cms_login'] = 0

In this line, you can clear the session value of cms_login after exit.

2. Then customize the session value of enabling cms_login in a php file for matching:

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

Thank you for reading! On the way to modify the phpcms background path to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report