kevisazombie Posted April 20, 2009 Share Posted April 20, 2009 Hi All, Is this possible? I have my site in a directory structure like this: home/ -user/ -user_images/ -user_files/ -twiki/ -public_html/ -index.php I would like to redirect incoming requests for http://www.mydomain.com/twiki to the twiki/ directory. I am not sure if it is possible because it is "behind the wall" in a web inaccessible folder. I am able to access user_images/ and user_files/ through relative urls in php. I was wondering if there was similar way with .htaccess like: RewriteRule twiki/$ ../twiki/ Quote Link to comment https://forums.phpfreaks.com/topic/154870-redirecting-behind-public_html-directory/ Share on other sites More sharing options...
jackpf Posted April 20, 2009 Share Posted April 20, 2009 I'm not sure if apache would allow you to do that, as anything outside of public_html can't be accessed by http request. Why not just have an index file that includes files in upper-level directories? Quote Link to comment https://forums.phpfreaks.com/topic/154870-redirecting-behind-public_html-directory/#findComment-814627 Share on other sites More sharing options...
kevisazombie Posted April 20, 2009 Author Share Posted April 20, 2009 Sorry I kind of simplified my example. Where I have the index.php listed in my directory structure I am actually hosting a pretty big web application. The web application runs on this MVC frame work that uses a .htaccess file to remap all incoming urls to index.php as GET variables. For example http://www.mydomain.com/twiki ends up as http://www.mydomain.com/index.php?1=twiki So the web app will not redirect to the twiki directory and will come back with an error as there is no controller for twiki. Currently I have the twiki directory under Public_Html and have modified .htaccess to direct accordingly. I would however like to keep the twiki out of the web apps files, and out of the public_html for organizational purposes. I thought this might be easy as my hosting provider has a cpanel directory setup behind the public_html which http://www.mydomain.com/cpanel is directed to. I'm thinking I would need to edit the apache config and add an alias or something. Also I suppose I could make a twiki controller for the web app which would redirect accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/154870-redirecting-behind-public_html-directory/#findComment-814756 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.