Presuming the next directory structure,


I must route all incoming demands using that php script. I've been trying some rewrite rules inside the htaccess, however i can't appear to have the ability to path to files which are outdoors the document root. I could not look for a reason behind this within the apache manuals, so eventually turned to "Include" an apache config file, in which the rules will vary.

It is possible to method of spinning outdoors from the docroot?

What lots of frameworks do is use rewrite to route all demands to 1 file where one can do more complicated routing of your. A good example .htaccess file may be:

# ignore anything that's an actual file (eg CSS, js, images) 
# redirect all other traffic to the index page
RewriteRule ^.*$ index.php [L]

Where index.php is within your doc root (htdocs/index.php) and from which you'll securely include System/index.php where appropriate.

No, you can't route outdoors the docroot without potentially enormous risk.

You need to put the index.php inside the htdocs folder and rewrite it there, not outdoors. Should you rewrite to handle index, being able to access outdoors the docroot, and also you made one little mistake it's potentially used by any hacker spinning the request string. Not pretty!