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
https://forums.phpfreaks.com/topic/33890-solved-preventing-access-to-single-file/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.