NancyJ
07-21-2011, 07:00 PM
A client has set up shopping cart software in a folder "shop". I don't actually know why but they want all requests to domain.com to go to domain.com/shop
This is what they have: (I don't know if they wrote it themselves or if the software created it when they installed it in a folder instead of the root)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . shop/index.php
That works fine for any request eg. domain.com/madeuppath loads the cart 404 and domain.com/realpath loads correctly but domain.com results in a 403 forbidden error. So I added DirectoryIndex shop/index.php then create a new .htaccess in shop that resets the DirectoryIndex back to index.php but there has to be a better/more elegant way than this.
This is what they have: (I don't know if they wrote it themselves or if the software created it when they installed it in a folder instead of the root)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . shop/index.php
That works fine for any request eg. domain.com/madeuppath loads the cart 404 and domain.com/realpath loads correctly but domain.com results in a 403 forbidden error. So I added DirectoryIndex shop/index.php then create a new .htaccess in shop that resets the DirectoryIndex back to index.php but there has to be a better/more elegant way than this.