here's my website organization:
index.php includes header, home, and footer files:
How should I set .htaccess so that MyWebSite/ is the only allowed URL?
You could try it this way. Block all php files except from localhost
or server IP address
.
For Apache < 2.4
<Files ~ "\.php">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Files>
<Files "index.php">
Order Allow,Deny
Allow from all
</Files>
For Apache >= 2.4
<Files ~ "\.php">
Require all denied
Require ip 127.0.0.1
</Files>
<Files "index.php">
Require all granted
</Files>
Mamp should be using Apache 2.4 so the 2nd example should work.