How can i protect Admin Directory?

Discussion in 'Site & Server Administration' started by mehdi, Jun 2, 2009.

  1. #1
    Hello, is there a way that actual admin directory is not viewable to visitors. Like if they visit http://mysite.com/admin they will get 404 error. I cannot rename admin directory because php is coded for only named "admin" folder, if i wish to rename admin folder it will make a big list of php errors. And secondly, if i can visit admin folder with a new name to get into admin panel.

    Thanks.
     
    mehdi, Jun 2, 2009 IP
  2. BMXRider09

    BMXRider09 Peon

    Messages:
    164
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hmmm...

    Try making your own 404 Page Does not Exist error page for the site and upload it as whatever you want. Then, for the admin panel, if they user level <2, then they get redirected to your error page. If it is =>2, then allow them to view the page.
     
    BMXRider09, Jun 2, 2009 IP
  3. RackSolidHost

    RackSolidHost Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    why dont you password protected using .htaccess
     
    RackSolidHost, Jun 2, 2009 IP
  4. currenz

    currenz Peon

    Messages:
    1,672
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use 'Password Protect Directories' of cpanel.
    1. select the folder
    2. create a user with strong password
    3. check 'Directory requires a password to access via the web (you must check this to activate password protection)'
    4. enter Protected Resource Name, eg admin panel, restricted area....
    5. click save
     
    currenz, Jun 2, 2009 IP
  5. ArmKaz

    ArmKaz Well-Known Member

    Messages:
    435
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    100
    #5
    I personally think that BMXRider09's idea is better than password protecting the directory. Password protecting can easily be cracked or hacked but when the person gets an 404 error message, they will most likely think that they have visited the wrong page for admin.
     
    ArmKaz, Jun 2, 2009 IP
  6. mehdi

    mehdi Peon

    Messages:
    258
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you guys, i can password protect the directories. But i don't want to show any one that my "admin" directory exists. Is there a way i can do that?
     
    mehdi, Jun 3, 2009 IP
  7. gary4gar

    gary4gar Peon

    Messages:
    496
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    simply rename index file to something else like home.php and put a dummy index file pointing 404 - page not found
     
    gary4gar, Jun 3, 2009 IP