Forum Moderators: phranque

Message Too Old, No Replies

Rewrite, but only if directly accessed?

Don't want to allow direct URL access to a specific file...

         

JosieNutter

2:41 am on May 1, 2005 (gmt 0)



I am a total mod_rewrite newbie, and I'm trying to figure out how to do something ... IF it CAN be done.

Let's say I have a file.

An embedded plugin calls this file by name.

Since there is no real way to disable viewing source, I want to use a "decoy" filename. Something that doesn't really exist.

If the plugin requests it, I want it to give it the real one, but if someone tries to go to the URL directly, they get nothing.

Is this possible?

jd01

7:30 am on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Josie,

Yes this is possible, but it's a little bit complicated.

You might want to look for information on basic rewriting, and then read-up on the condition {THE_REQUEST}... I just posted an example in another thread, so that might give you some ideas and a direction to go. Then when you have what you think will work, or an idea of exactly what you need, post it here, and someone will help walk you through it.

Hope this gives you an idea of where to start.

Justin