0

Id like to deny access to everything, except /json-rpc, which should be redirected to /json-rpc.php. My current configuration is:

Options -Indexes

Order Deny,Allow 
Deny from All 

<Files "json-rpc"> 
     Order Deny,Allow 
     Allow from All
</Files>

<Files "json-rpc.php"> 
     Order Deny,Allow 
     Allow from All
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^json-rpc$ json-rpc.php [NC,L]
</IfModule>

The problem with this is that it allows access to /json-rpc.php directly. How do I make it so that /json-rpc is the ONLY resource available?

4

1 回答 1

1

Include this rule inside your <IfModule mod_rewrite.c> block:

RewriteCond %{THE_REQUEST} json-rpc\.php
RewriteRule ^ - [L,F]

This forbids requests directly for json-rpc.php.

于 2012-10-28T20:16:57.943 回答