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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts

    how can you block a browser URL but not a web site accessing files

    Hi All,

    It seems I have completely misunderstood how htaccess file blocking works and wonder if anyone can explain how to do what I want or say if it is just not possible.

    I thought you could add a code in a htaccess file which stopped anyone from accessing a file stored on your host. In so much as, if you have a name of a file and host address and put the URL into a browser the access to the file would be blocked. However, if the web page on a host needed that file it could load it to show on the web site.

    It is possible to block hot links access from another server using a common code but not a computers users browser.

    There is a htaccess password code which works to stop a browser finding a file which is fine. But if that is used and the sites web pages use iFrames to load other pages the password field appears.

    Is it possible to pre code something so that password blocking could be used but have it self bypass when the actual hosted web pages are wanting to load another page into an iFrame.

    I know I am likely not explaining this well but if you understand generally can you make a suggestion or two.

    Martin.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,665
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    I understand you very well and I’ll have to say that you should perhaps ask yourself whether an iframe is really the best choice here or you can redesign your site to not use an iframe?

  • #3
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    try putting the username and password in the iframe src attribute

    Code:
    http://username:password@[www.]site.tld/folderpath/filename.ext/
    Always bearing in mind that if the document holding the iframe is outside the protected location you are exposing the username and password.


  •  

    Posting Permissions

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