Hiding a script

New to mod_rewrite? This is a good place to start.

Hiding a script

Postby bkputnam » Mon Nov 02, 2009 3:59 pm

Hi all,

I have the following situation:
I have a file a.php. For various reasons, I cannot rename it.
I would like requests for a.php to return some sort of 400
I would like requests for b.php to return the contents of a.php

This seems like a great place for mod_rewrite, but I can't seem to get my rules right. I am using the following rules to (try to) accomplish this:

RewriteRule ^a.php$ fakefile.php [L,G]
RewriteRule ^b.php$ a.php [L]

However, requests for both a.php and b.php return (paraphrased) "a.php is Gone". My question is, how can I prevent the output of the second rule from being fed back into the first rule? I thought either putting it second, or using the [L] option would do the trick, but no luck. Any ideas?

Thanks in advance!

-B
bkputnam
 
Posts: 1
Joined: Sat Oct 31, 2009 10:05 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 31 guests

cron