Search code examples
php.htaccess

How can i limit users to only view index.php but not limit <link> <Script src> and php from accessing thos files


i havnt realy tried much besides

Order deny,allow
Deny from all

<Files "index.php">
    Allow from all
</Files>

it worked but it also prevented php and link tags from accesign other files


Solution

  • When you write any script or link in your code, they won't send request to server themselves, it's actually user sending request for that resource. If there is a link to any resource to any part of your server and you want it to be served, you must let browser access that and browser means user.