Rename Zen Cart Admin folder for increased security


Access to your store Admin is protected by username and password.  However, unauthorized access (or access attempts) are one step closer if all Zen Cart stores have the Admin files in a known location (ie /admin).  As an added precaution it is recommended that you rename your admin folder after installation. And it’s easy to do in just three steps.

Think of a new folder name.  For maximum security you may want to consider using a combination of numbers, upper and lower case letters in the folder name.  An easy way to remember your new folder name is to use the initials of a phrase such as a song name.  As an example take Lucy in the sky with diamonds by The Beatles from 1967.  The admin folder name could be litswdTB67.

Before you start, make sure you have a current backup of both your Zen Cart store files and the Zen Cart store database.

While this is a simple change, it needs to be addressed carefully.  Do not use a find-and-replace feature to make these changes. Also, pay particular attention to avoid making changes to the forward slash part of the paths (/).

  1. Edit the /admin/includes/configure.php file

    Change the file permissions on admin/includes/configure.php file to be writable.

    Using your favourite FTP program, download a copy of the /admin/includes/configure.php file and open it with a simple text editor.

    Change all instances of admin to your chosen new admin folder name.

    Change this section:

    define('DIR_WS_ADMIN'), '/admin/');
    define('DIR_WS_CATALOG'), '/');
    define('DIR_WS_HTTPS_ADMIN'), '/admin/');
    define('DIR_WS_HTTPS_CATALOG'), '/');

    And this section:

    define('DIR_FS_ADMIN'), '/home/mystore/www/public/admin/');
    define('DIR_FS_CATALOG'), '/home/mystore/www/public/');

    After your changes :

    define('DIR_WS_ADMIN'), '/litswdTB67/');
    define('DIR_WS_CATALOG'), '/');
    define('DIR_WS_HTTPS_ADMIN'), '/litswdTB67/');
    define('DIR_WS_HTTPS_CATALOG'), '/');

    And this:

    define('DIR_FS_ADMIN'), '/home/mystore/www/public/litswdTB67/');
    define('DIR_FS_CATALOG'), '/home/mystore/www/public/');

    Upload the modified file using your FTP program.

    Reset the file permissions to Read-Only.

  2. Rename the admin folder

    Using your FTP program or your webhost’s File Manager, rename the admin folder to match the name you selected above (for example, litswdTB67).

    This is a matter of either selecting the file and clicking on Rename or right-clicking on the file and selecting Rename.

  3. Login to the Zen Cart Store Admin with the new address

    Accessing your store admin is now via the new address.  In this example, instead of visiting http://www.store.com/admin/, it is now http://www.store.com/itswdTB67/.

     
   
     

,

More Zen Cart:

  1. Log in to your Zen Cart Admin
  2. Upgrade to Zen Cart 1.39g – Admin Warning
  3. Remove zc_install folder
  4. Adding a new Admin user in your Zen Cart Store
  5. Zen Cart Admin > Configuration Menu
  1. #1 by Adam Haworth on 4 August, 2011 - 9:01 am

    Thanks for the useful tips, I have had trouble with my Zencart after changing the admin folder name. no longer can I log in??

(will not be published)

Notify me of followup comments via e-mail. You can also subscribe without commenting.