Text Size
Sunday, May 20, 2012
Get a look down
Thursday, 08 September 2011 09:35

How to change Drupal's admin path

Written by Nabil Sadki
Rate this item
(0 votes)

All Drupal's based websites come's with the same administration path /admin, so if someone know that your site is built with Drupal, he can easily access the admin access page. This path can be changed easily with this little configuration. Just place this code snippet in your settings.php file, and change the admin word with the one you wan't :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Change mywebpanel with the word you need
// Admin page can be seen with the new link : http://www.mywebsite.com/mywebpanel
function custom_url_rewrite($op, $result, $path) {
 
  if ($op == 'alias') {
    if (preg_match('|^admin(/{0,1}.*)|', $path, $matches)) {
      return 'config'. $matches[1];
    }
  }
 
  if ($op == 'source') {
    if (preg_match('|^mywebpanel(/{0,1}.*)|', $path, $matches)) {
      return 'admin'. $matches[1];
    }
  }
 
  return $result;
 
}
Last modified on Thursday, 08 September 2011 10:01
Nabil Sadki

Nabil Sadki

Hello, I am Nabyl, a Freelance web developer and a joomla addict. I have made many sites using the latter, but also patches for the core of this CMS. I like HipHop culture and world of warcraft. You can find find me on Twitter when i'm free...

Website: www.coins.ma E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Add comment



3 comments

  • Comment Link iwc replica Wednesday, 07 March 2012 02:09 posted by iwc replica

    Your article is great , I read your article to learn a lot and hope to see your next article, look forward to your masterpiece, you can also see our ball gowns information, I hope it can give you You some convenient

    This e-mail address is being protected from spambots. You need JavaScript enabled to view it
  • Comment Link Nabil Sadki Wednesday, 15 February 2012 21:41 posted by Nabil Sadki

    Right, this tip is for D6, and for D7 also for those who don't wan't to use a new module

    This e-mail address is being protected from spambots. You need JavaScript enabled to view it
  • Comment Link anonyous Wednesday, 18 January 2012 11:29 posted by anonyous

    A module exists for D7 : rename_admin_path.

    This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Usefull tricks