Jump to content

*SOLVED* Preventing access to single file


irken

Recommended Posts

Hello.

Here's the scenario.. I have a file called test.xml in /services/test.xml. I would like to be able to access this file from my javascript code elsewhere, but I don't want the users to be able to fetch it by typing in the URL to said file. Is this possible?

I tried doing something like

[code]
RedirectMatch 301 /.* http://www.google.com/
[/code]

That resulted in not being able to use the file from the script.

Ideas? I have no intention of using PHP to retreive it's contents and whatnot. Thanks.
Link to comment
Share on other sites

[quote author=steviewdr link=topic=122094.msg503183#msg503183 date=1168617147]
Your could urlencode the URL in javascript. The URL will still be there in plain view - but it wont be easy to solve - i.e. a person would have to urldecode the URL to see it in plain text.

-steve
[/quote]

That might be a good idea, I'll have to read up on that.

Thank you.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.