SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    714
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it necessary to put all files that need protection in a single folder?

    I have uploaded a site and have a few pages which I do not want everybody to see. Only those with access to the password should be able to view it. I have used the Password protect directories of the cpanel of my host. I am able to protect a folder containing the files but when I try to protect an individual file, I find that I end up protecting my full site itself so that one needs a password to just see the site. Can I not protect individual files?

  2. #2
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I need to protect any files, as you are saying, I do tend to put them in a subfolder, protect it with htaccess and stick an index.php that redirects to the main site.

    What are these pages? Are they includes to other sections of the site or administration pages for changing settings etc?

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The only way to protect individual pages rather than whole folders is if you build the protection into the web page itself using a server side language.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    714
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, felgall. I will try working on my php code to set a password.

    ilkoni, these pages are administration pages for uploading and editing photos which only the client should be able to use with the help of a password. The reason why I asked whether I could protect individual pages is because I was facing problems while trying to protect a whole folder.
    I had put all the administration pages in a folder but my images folder was outside in the public_html folder of my cpanel. So the photos that I had been uploadig was not getting uploaded to the folder as it was outside the protected directory containing the upload.php file. I was also facing a myriad of similar problems.


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
  •