I'm not a web development guy, but from what I understand the following are true:
index.php in a browser spits out the page code that the browser receives and renders. So the browser requests:
script/ directories. So the browser requests:
In order to include these files, the browser must request those URLs from your webserver, and your webserver must serve them from those URLs.
If so, then no, you can't do what you're asking without changing how your CSS and script files are included.
You could change the PHP, so that it's output doesn't include links to external files, but rather includes the content of those files as inline sections of the PHP output. Then you can use the webserver's standard access controls to disallow access to the