13 June 2013

How to change Joomla Admin Folder Name or Path ?

0 comments
Many times people ask me, how you secure your joomla website,specially how to protect your admin side of website.So I think about to change the admin url.
By default, every joomla programmer know the default url of admin directory i.e. http://sitename.com/administrator/ .

So I want to hide or just don’t want to give direct access to that url, after googling, found that changing the folder name ‘administrator’ to ‘myadmin” & change the ,

define( ‘JPATH_ADMINISTRATOR’, JPATH_ROOT.DS.’administrator’ );  to
define( ‘JPATH_ADMINISTRATOR’, JPATH_ROOT.DS.’myadmin’ );
in the ‘includes->defines.php’ & ’administrator->includes->defines.php’ doesn create some problem in thired party component.

So finally I found another trick which work for me, is as below.


1. Create a new directory in your root directory (eg. “myadmin”)
2. Create an index.php file in your “myadmin” directory..

<?php
$admin_cookie_code=”999999999″;
setcookie(“JoomlaAdminSession”,$admin_cookie_code,0,”/”);
header(“Location: ../administrator/index.php”);
?>

3. Add this to the beginning of index.php in real administrator folder
 
#administrator/index.php (modify , **do not replace**)
if ($_COOKIE['JoomlaAdminSession'] != “999999999″)
{
header(“Location: ../index.php”);
}
This works for me, I hope it will help others also.

0 comments:

Post a Comment