php - Redirects with .htaccess stops images from loading -


ok i'm looking redirect following:

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

to following:

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

the following regex mix of of answers question solves issue:

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, when try , load image server within directory http://www.example.org/img/imagename.png. gives me 500 internal server error , when checking logs i'm given message:

[wed feb 23 12:27:27 2011] [error] [client xx.xx.xx.xx] mod_rewrite: maximum number of internal redirects reached. assuming configuration error. use 'rewriteoptions maxredirects' increase limit if neccessary.

does know what's going on there?

thanks

above rewriterule add these 2 lines:

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d 

these tell mod_rewrite ignore actual files , directories. should fix /img/ problem.

you shouldn't need rewritecond $1 (^/include/) these lines.

to fix /img folder, try this:

rewriterule ^file/img/(.*)$ /img/$1 [l] 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -