New Zenner
- Join Date:
- Feb 2007
- Posts:
- 15
- Plugin Contributions:
- 0
Securing /includes/admin by renaming; problem with links
https://www.zen-cart.com/tutorials/index.php?article=73
2. Rename your /admin folder
It is recommended for additional security that you rename your admin directory after installation. This way, it will be significantly harder for hackers to find your admin area or attempt any attack on breaking into it.
(Before making the following changes, make sure to have a current backup of your files and your database.)
A - Open your admin/includes/configure.php, using a simple text editor like notepad. Change all instances of admin to your chosen new admin folder-name. For maximum security, you may want to consider that new folder name should include numbers and a combination of upper and lower case letters. The longer you make this folder's name the more secure it will be. Make sure you leave all the / intact.
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.com/www/public/admin/');
define('DIR_FS_CATALOG', '/home/mystore.com/www/public/');
B - Find your Zen Cart™ /admin/ directory, using your FTP software or your webhost File Manager. Rename the directory to match the settings you just made in step A.
C - To login to your admin system you will now have to visit a new URL that matches the new name used in steps A and B above. For example instead of visiting http://www.example.com/admin/ visit http://www.example.com/NeW_NamE4u/. Use of SSL is highly recommonded to protect your and your customers information. To protect the new admin folder name from packet sniffers, use https in the example link above (this of course depends on your server having an SSL certificate installed).
D - You should also protect your admin area by using an .htaccess file similar to the one shown below, and placing it into /admin/includes. This should already exist in Zen Cart™ versions 1.2.7 and greater.
Say I renamed my admin section to xyz123. Whenever I try to access anything it still points to admin instead of xyz123. I changed the following
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.com/www/public/admin/');
define('DIR_FS_CATALOG', '/home/mystore.com/www/public/'); to
define('DIR_WS_ADMIN', '/xyz123/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/xyz123
/');
define('DIR_WS_HTTPS_CATALOG', '/');
And this section:
define('DIR_FS_ADMIN', '/home/mystore.com/www/public/xyz123
/');
define('DIR_FS_CATALOG', '/home/mystore.com/www/public/');
Is this correct? Why do all the hyperlinks in the admin section still have every link pointed to the admin directory instead of the
xyz123 directory?