So I am searching to redirect the next:

http://www.example.org/tag/code

Towards the following:

http://www.example.org/tag.php?tag=code

The next regex is a mixture of a few of the solutions for this question which solves the problem:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule (.+)/ $1.php [L,NC]
RewriteRule (.+)/(.+) $1?tag=$2 [L,NC]

However now, after i try to load a picture from the server that is inside the directory http://www.example.org/img/imagename.png. It provides me with a 500 Internal Server Error so when checking the logs I am with all this message:

[Get married February 23 12:27:27 2011] [error] [client xx.xx.xx.xx] mod_rewrite: most of internal redirects arrived at. Presuming configuration error. Use 'RewriteOptions MaxRedirects' to boost the limit if needed.

Does anybody know what's happening there?

Thanks

Try:

RewriteRule (.+?)/(.+) $1.php?t=$2 [L,NC]

Above your RewriteRule add these 2 lines:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

These will inform mod_rewrite to disregard actual files and sites. This will fix your /img/ problem.

You should not need RewriteCond $1 (^/include/) with one of these lines.

To repair the /img folder, do this:

RewriteRule ^file/img/(.*)$ /img/$1 [L]

Perhaps you have attempted this?

Options +FollowSymLinks RewriteEngine On

RewriteRule (.+)/(.+) $1.php?t=$2 [L,NC]
RewriteRule (.+)/ $1.php [L,NC]