RewriteRule

I am using modrewrite for SEO purposes but when I try to load an image that exists the rule is blocking the image.

.htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^library/(.*)$ index.php?type=public&section=library&$1 [QSA,L]

Open in new window


So this works, the directory library exists but there is no index so index.php?type=public&section=library&$1 is loaded. However, inside library is a directory called img and the images in that directory won't load. I know it is the rule because if I turn the rule into say ^library/index.php then the images load.
LVL 7
Robert SaylorSenior DeveloperAsked:
Who is Participating?
 
Robert SaylorConnect With a Mentor Senior DeveloperAuthor Commented:
I think I solved my answer

I added this and the images are loading now.

RewriteRule ^library/img/(.*)$ library/img/$1 [QSA,L]
0
 
Robert SaylorSenior DeveloperAuthor Commented:
solved my own question
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.