You are here

README.txt in Rename Admin Paths 7

Same filename and directory in other branches
  1. 8.2 README.txt
  2. 8 README.txt
  3. 7.2 README.txt
README.txt
==========
The purpose of this module is to secure drupal backend by overriding admin path.
It's will rename path like '/admin/...' to '/something/...' or path '/user/..' 
to '/something else/..'. This module can be effective against registration spam 
bots or malicious people.
It's just implements hook_outbound_alter and hook_inbound_alter to rename paths.


Installation
------------
1. Install this module like any other Drupal module (place it in the
modules directory for your site and enable it on the `admin/build/modules` page.
2. Go to admin/config/user-interface/rename-admin-paths and configure how to 
override admin paths.


Drupal 6
--------
If you are using Drupal 6, you can get the same feature by using the following 
code in your settings.php file.

function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
    if (preg_match('|^admin(/{0,1}.*)|', $path, $matches)) {
        $path = 'backend'. $matches[1];
    }
}

function custom_url_rewrite_inbound(&$result, $path, $path_language) {
    if (preg_match('|^backend(/{0,1}.*)|', $path, $matches)) {
        $result = 'admin'. $matches[1];
    }
    if (preg_match('|^admin(/{0,1}.*)|', $path, $matches)) {
        $result = '404'. $matches[1];
    }
}

File

README.txt
View source
  1. README.txt
  2. ==========
  3. The purpose of this module is to secure drupal backend by overriding admin path.
  4. It's will rename path like '/admin/...' to '/something/...' or path '/user/..'
  5. to '/something else/..'. This module can be effective against registration spam
  6. bots or malicious people.
  7. It's just implements hook_outbound_alter and hook_inbound_alter to rename paths.
  8. Installation
  9. ------------
  10. 1. Install this module like any other Drupal module (place it in the
  11. modules directory for your site and enable it on the `admin/build/modules` page.
  12. 2. Go to admin/config/user-interface/rename-admin-paths and configure how to
  13. override admin paths.
  14. Drupal 6
  15. --------
  16. If you are using Drupal 6, you can get the same feature by using the following
  17. code in your settings.php file.
  18. function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
  19. if (preg_match('|^admin(/{0,1}.*)|', $path, $matches)) {
  20. $path = 'backend'. $matches[1];
  21. }
  22. }
  23. function custom_url_rewrite_inbound(&$result, $path, $path_language) {
  24. if (preg_match('|^backend(/{0,1}.*)|', $path, $matches)) {
  25. $result = 'admin'. $matches[1];
  26. }
  27. if (preg_match('|^admin(/{0,1}.*)|', $path, $matches)) {
  28. $result = '404'. $matches[1];
  29. }
  30. }