mod_rewrite makes no sense to me
Posted: Sat Jan 31, 2009 8:14 pm
I have tried about a million things that I thought should have worked to no avail. I'm playing around with the symfony framework trying to get things working the way I want.
I have a path /home/username/public_html/project/web/
The webroot is /home/username/public_html/
When I pull up http://localhost I get a list of projects that I am working on. Symfony places the files for a project inside of a subfolder.
So if I request http://localhost/projectname I get framework files instead of the website. Symfony documenation wants you to setup a virtual host for each project, which isn't something I want to do.
What I want is to transparently rewrite http://localhost/projectname to http://localhost/projectname/web. This should by very, very simple to do, but nothing I have tried works.
Here's what I've got:
/home/username/public_html/project/.htaccess
Also, how would I go about adding an Alias into this file? Apache complained..
I have a path /home/username/public_html/project/web/
The webroot is /home/username/public_html/
When I pull up http://localhost I get a list of projects that I am working on. Symfony places the files for a project inside of a subfolder.
So if I request http://localhost/projectname I get framework files instead of the website. Symfony documenation wants you to setup a virtual host for each project, which isn't something I want to do.
What I want is to transparently rewrite http://localhost/projectname to http://localhost/projectname/web. This should by very, very simple to do, but nothing I have tried works.
Here's what I've got:
/home/username/public_html/project/.htaccess
Code: Select all
Alias /sf /usr/share/php/data/symfony/web/sf
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !^web.* [NC]
RewriteRule ^(.*)$ web/$1 [L]
/home/username/public_html/project/.htaccess: Alias not allowed here