Jimako-e107-plugins / e107-old-plugins

Just backup
4 stars 4 forks source link

Change your e107 folder names #7

Open Jimmi08 opened 4 years ago

Jimmi08 commented 4 years ago

Change your e107 folder names

e107 uses the following folder names in its root directory by default:

e107_admin
e107_docs
e107_files
e107_handlers
e107_images
e107_languages
e107_plugins
e107_themes

However, you are not constrained to use these folder names. You are free to change these folder names so that your URLs change from something like

http://yoururl.com/e107_plugins/content/ To the more manageable

http://yoururl.com/p/content/

Why There are several reasons why you may want to rename these core folders. The most common is the desire for shorter URLs, which are more attractive and may contribute to SEO. In this instance, the folder name to change would probably be e107_plugins. Since plugins constitute the bulk of many e107 sites, having the format of yoursite.com/e107_plugins/plugin/ can lead to long URLs throughout the site.

Alternatively, you may want to change the URLs of folders for 'security through obscurity', ie. renaming the e107_admin folder to something users are less likely to guess and attempt to access. While many would see it as important that their users cannot access the admin login page, it is important to remember that this is neither imperative for the security of your site, nor the only step to take in order to achieve maximum security.

Why Not While renaming e107's folders has advantages, it also has disadvantages. Chiefly, renaming the folders on an existing site can invalidate sitelinks, in addition to rendering any incoming links as obsolete. Furthermore, any plugins or themes with hardcoded links or references to themselves will cease to work properly; however, the majority of e107 plugins are coded to use e107 Constants like {e_PLUGIN} instead of using the full folder path e107_plugins so they will continue to work after the change of directory name.

Warning: renaming the e107 core folders will mean that you will also need to rename the folders in update packages to e107. Otherwise, the update's e107_plugins folder will simply be uploaded next to your plugins folder, rather than overwriting (and updating) your existing files.

How Install e107 normally, leaving the folder names as their defaults. Rename the folders you want to change. Open e107_config.php in the e107 root folder. You should see a section regarding these folder names, looking something like the following:

$ADMIN_DIRECTORY     = "e107_admin/";
$FILES_DIRECTORY     = "e107_files/";
$IMAGES_DIRECTORY    = "e107_images/";
$THEMES_DIRECTORY    = "e107_themes/";
$PLUGINS_DIRECTORY   = "e107_plugins/";
$HANDLERS_DIRECTORY  = "e107_handlers/";
$LANGUAGES_DIRECTORY = "e107_languages/";
$HELP_DIRECTORY      = "e107_docs/help/";
$DOWNLOADS_DIRECTORY = "e107_files/downloads/";

Now, update the relevant definition to the new folder name. For instance, if you renamed your e107_plugins/ folder to p/ and your e107_admin/ folder to adm1n/ you would change the following lines:

$ADMIN_DIRECTORY     = "e107_admin/";
$PLUGINS_DIRECTORY   = "e107_plugins/";

To become:

$ADMIN_DIRECTORY     = "adm1n/";
$PLUGINS_DIRECTORY   = "p/";
  1. Open robots.txt in the e107 root folder. After a fresh install the file should look like this:
User-agent: *
Disallow: /e107_admin/
Disallow: /e107_install/
Disallow: /e107_handlers/
Disallow: /e107_files/cache/
Disallow: /e107_files/public/avatars/

To complete the example of the previous step; change it into the following (or to your own preference):

User-agent: *
Disallow: /adm1n/
Disallow: /e107_install/
Disallow: /e107_handlers/
Disallow: /e107_files/cache/
Disallow: /e107_files/public/avatars/

Now, return to your site's homepage. Ensure that no errors are displayed, log into your admin area (using the new URL if you have changed the e107_admin folder name), and update your site links to correspond with your new folder names' URLs.