I want my vhost to rewrite urls such as:
http://dev.example.com/cool/story/bro
To:
http://dev.example.com/index.php?url=cool/story/bro
Unless specifying an existing file such as:
http://dev.example.com/images/duck.png
It works fine but when I have a url which uses an existing folder such as:
http://dev.example.com/images
It strangely redirects to:
http://dev.example.com/images/?url=images
When it should rewrite to:
http://dev.example.com/index.php?url=images
Here's my current code:
<VirtualHost *:80>
ServerName dev.example.com
DocumentRoot /var/www/dev/public
php_flag display_errors 1
php_value error_reporting 30719
<Directory "/var/www/dev/public">
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [L]
</Directory>
</VirtualHost>
I've been trying to fix it for hours but I can't see the problem, hope you can help.