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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.