SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Setting up website and need some help

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting up website and need some help

    Well, I'm setting up my (personal) webiste, and I was wondering if I'm doing it correctly.
    My root (www) folder has two folders, public and admin. I used htaccess to redirect root to /public folder, and this folder will be have all the files for public view, so in a way it will behave like root folder.
    In protected admin folder (inside root) with htaccess, and here i will have all the files to add news, articles etc., where i will administrate my site.
    Also, this admin folder is only accessed if you manually type mywebsite.com/admin.
    So I was wondering, is this structure a good practise, or should I change something?
    Tnx!

  2. #2
    SitePoint Guru
    Join Date
    Jul 2005
    Posts
    609
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It'll work, but in my opinion it's one more thing that "could break" - you're adding a level of complexity (although minimal) to your personal website. Any reason not to have "admin" right in your www folder with all the rest of the stuff and not rely on any type of redirection?

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I was reading somewhere that it would be better to make admin folder outside of the root directory (www), for security reasons.

  4. #4
    SitePoint Guru
    Join Date
    Jul 2005
    Posts
    609
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd be interested to hear what other people have to think, but normally the reason to keep stuff outside of your webroot is so that people cannot access it directly. An example:

    \(root)
    +www
    +passwords
    +statlogs

    In the structure above, you could put all your content into www, some password files into passwords and logs into the statlogs. If "www" is configured as your webroot, someone can't come along and go to www.example.org/passwords to get your password files. Nor could they directly access your statlogs.

    However, given it had the right permissions, PHP, ColdFusion, or whatever application could read into these directories in your file system if they had permission to. If you're planning to allow /admin to basically just point to the admin folder, then you're adding no protection to it by moving it outside of the webroot --- since it's "virtually" in the webroot anyway.

Bookmarks

Posting Permissions

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