Zen Cart 修改管理页面的目录名
在修改前,建议备份好程序和数据库.
1- 打开文件 admin/includes/configure.php.
将所有出现 /admin/ 的地方改成自己定义的名字
需要修改的部分:
// NOTE: be sure to leave the trailing ‘/’ at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace … (ie: under the public_html or httpdocs folder)
define(‘DIR_WS_ADMIN’, ‘/admin/’);
define(‘DIR_WS_CATALOG’, ‘/’);
define(‘DIR_WS_HTTPS_ADMIN’, ‘/admin/’);
define(‘DIR_WS_HTTPS_CATALOG’, ‘/’);
需要修改的部分:
// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define(‘DIR_FS_ADMIN’, ‘/home/mystore.com/www/public/admin/’);
define(‘DIR_FS_CATALOG’, ‘/home/mystore.com/www/public/’);
2- 找到Zen Cart的目录/admin/ 。将该目录名按照 admin/includes/configure.php 中的定义作相应修改。
3. 利用apache的.htaccess访问机制可以保护这个目录!
具体实现:
利用htpasswd生成口令文件及用户名称与口令
再在admin目录中修改.htaccess内容为:
AuthName “Authorization Login”
AuthType Basic
AuthUserFile /你的密码文件路径/你的密码文件
Require valid-user
(通常主机商提供的控制面板中,都能设置目录保护,不用手工设置。)