php - Redirects with .htaccess stops images from loading -
ok i'm looking redirect following:
to following:
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
Post a Comment