Jump to content

mod_rewrite looking outside document root


vertigoalopolus

Recommended Posts

im working on a project site that has its document root set to ~/sitename/www/, which holds all publicly accessible files (images, css, templates), and an .htaccess file with a mod_rewrite rule that points literally everything that isnt a valid and publicly accessible file to redirect.php, in the parent directory ~/sitename/.

 

however, when i try to load up the sites domain, it returns a 400 bad request error code. i tried copying redirect.php to ~/sitename/www/, and modifying the .htaccess accordingly, and it accesses it fine in there. but i dont want that file (or its siblings - including subdirectories holding controllers) directly accessible by the public!

 

is there a way i could have those files in the parent directory accessible by the web server, but still not publicly accessible?

 

this is for an ongoing MCV style site framework that ive been working on for some time for the sites i build, so a solution would be appreciated!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.