trq Posted July 9, 2007 Share Posted July 9, 2007 I'm basically looking to direct any requests to my front controller which is stored outside of my webroot. The full path is /home/thorpe/mymvc/core/init.php. Iv'e tried using... <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /home/thorpe/mymvc/core/init.php/$1 [L] </IfModule> However I'm getting permissions errors because I don't have any index.php within my web root and directory browsing permissions are disabled. However, given my rule I shouldn't need anything in my web root accept my .htaccess file. However, of course, the rule seems to be looking for /home/thorpe/mymvc/core/init.php somehow relative to my web root. Any ideas? Link to comment https://forums.phpfreaks.com/topic/59115-solved-full-path-within-rewriterule/ Share on other sites More sharing options...
trq Posted July 9, 2007 Author Share Posted July 9, 2007 OK... Ive decided on a different approuch now. Ive made a symlink in my web root pointing to my mymvc framework. My .htaccess now looks like... <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ mymvc/core/init.php/$1 [L] </IfModule> This particially works. If I go to http://localhost or http://localhost/ I get the same permissions error about not having permissions to access / (rememeber, I have no directory browsing enabled). However, if I access via http://localhost/anythingatallhere my request is sent through to my front controller. How do I go about getting all requests to http://localhost to be sent aswell? Link to comment https://forums.phpfreaks.com/topic/59115-solved-full-path-within-rewriterule/#findComment-293622 Share on other sites More sharing options...
trq Posted July 10, 2007 Author Share Posted July 10, 2007 Anyone? Link to comment https://forums.phpfreaks.com/topic/59115-solved-full-path-within-rewriterule/#findComment-294291 Share on other sites More sharing options...
trq Posted July 12, 2007 Author Share Posted July 12, 2007 A simple solution in case anyone else needs it. I simply added the DirectoryIndex directive. My complete .htaccess file now looks like.... DirectoryIndex mymvc/core/init.php RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ mymvc/core/init.php/$1 [L] Link to comment https://forums.phpfreaks.com/topic/59115-solved-full-path-within-rewriterule/#findComment-296022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.