I want to redirect old pages (like "index.php/sdasdasd/sdasda/") to their new content. I'm using PHP to do this, as the data is stored in MySQL. The problem is that when the url starts with "index.php" it isn't redirected to the correct page. In the background it should call: "index.php?url=index.php/sdasdasd/sdasda/". How can I fix this in the .htaccess?
RewriteEngine on
RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
RewriteRule ^(.*/)?\.svn/ - [F,L]
RewriteRule \.(gif|jpg|png|css|flv|js|swf|php)$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+\.php)$ index.php?url=$1 [QSA,L]
RewriteCond %{REQUEST_URI} !(\.)
RewriteCond %{REQUEST_URI} !(\.)
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} .*
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
If you have any other improvements to this code, then you're welcome to suggest changes.