Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts

    should the admin directory be inside the public_html with password or outside

    hi,

    I my website i have placed the admin directory inside the public_html.
    You can say almost my every other directory is inside the public_html.

    Is that safe or public_html should only contains scripts which the users have access to .

    Is there any guide on how should be the directory structure of a website
    Please de-reputate me
    © 0o0o0o0

    Its better to rule in Hell then to serve in Heaven

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    If you can put the password outside. Ideally you can put the username and password in a database then just check the posted stuff with the database stuff. Be sure to use mysql_real_escape_string on the posted stuff as to prevent mysql injection. Btw how will you get to the admin directory yourself if its outside of the public_html directory?

    As to a guide, no there really isn't one but to keep files together its better to create directories for them. For example I have an index page and a directory called inc. In inc I put all of my includes. Then I have a folder called js. I put all my .js files in there. Same goes for CSS. Same goes for images. I have an admin directory that contains only files that would be used by the admin pages. If you are using includes be sure to prevent them from being accessed directly.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    Currenly my files in the include folder are listing on the website when i use

    ...com/include/

    How can i prevent it
    Please de-reputate me
    © 0o0o0o0

    Its better to rule in Hell then to serve in Heaven

  • #4
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    Found it

    put

    Code:
    IndexIgnore * or Options -Indexes
    in the .htaccess file in that directory
    Last edited by o0O0o.o0O0o; 05-15-2008 at 07:13 AM.
    Please de-reputate me
    © 0o0o0o0

    Its better to rule in Hell then to serve in Heaven


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •