Exposing the backend address of a website is a very dangerous thing. For example, the backend address of my website is: Admin Login

The Internet is a complex world, and every webmaster must learn to protect himself.

The default background path of emlog is the admin directory, which exposes important information very nakedly.

There are three steps to modify the default background path:

Open the admin directory, find globals.php, and open it with editplus or other editors. If you want to open it with notepad, you can do it ^_^ No consequences.

Change the folder admin to the name you want, such as xxxx.

Open the file admin/globals.php. It may be xxxx/globals.php now.

Modify line 9 of code:

define(‘TEMPLATE_PATH’, EMLOG_ROOT.’/admin/views/’);

Change admin to your new name xxxx:

define(‘TEMPLATE_PATH’, EMLOG_ROOT.’/xxxx/views/’);

Step 3: After refreshing the backend login, hide “Login” in the navigation settings, otherwise a 404 error will appear when you click it. How annoying~

Solve some sequelae:

1. After changing the background path, Weiyu’s expression pictures cannot be displayed. Solution:

Open include/lib/function.base.php and find

$t = str_replace($data,’’,$t);

Replace admin with xxxx:

$t = str_replace($data,’’,$t);

2. If there is no new avatar uploaded in the personal settings in the backend, the Weiyu avatar cannot be displayed in the frontend. Solution:

Open t/index.php and find

$avatar = empty($user_cache[UID][‘avatar’]) ? ‘../admin/views/images/avatar.jpg’ : ‘../’ . $user_cache[UID][‘avatar’];

Replace admin with xxxx:

$avatar = empty($user_cache[UID][‘avatar’]) ? ‘../xxxx/views/images/avatar.jpg’ : ‘../’ . $user_cache[UID][‘avatar’];

Then open t.php in the template, that is, content/templates/template name/t.php and find

BLOG_URL . ‘admin/views/images/avatar.jpg’ :

Replace admin with xxxx:

BLOG_URL . ‘xxxx/views/images/avatar.jpg’ :

  1. Solve the link problem of the “click back” button when the template is damaged. The default is admin, and an error occurs after clicking:

Open include/lib/view.php and find

emMsg(‘The currently used template has been deleted or damaged, please log in to the background to replace other templates.’, BLOG_URL . ‘admin/template.php’);

Replace admin with xxxx:

emMsg(‘The currently used template has been deleted or damaged, please log in to the background to replace other templates.’, BLOG_URL . ‘xxxx/template.php’);

4. Solve the problem of edit button link on the article list page,

Open the module.php file of the template and find

$editflg = ROLE == ROLE_ADMIN || $author == UID ? ‘Edit’ : ‘’;

Replace admin with xxxx:

$editflg = ROLE == ROLE_ADMIN || $author == UID ? ‘Edit’ : ‘’;

Okay, the tutorial is over, let’s go and do whatever we have to do~

Of course, there are more sequelae than the ones I listed above.

In order to modify this, I have cleared and restored the website so many times, I am exhausted!