.htaccess - htaccess block everything but 1 file and 1 folder -


i have seen number of posts similar wasn't able achieve actual desired feel.

so have. need have past urls forward index.php file. fine , have far, need add exception of specific folder 'images' folder images show up, b/c since i'm forwarding index it's not grabbing right images because blocking them.

currently have this

options +followsymlinks rewriteengine on rewritecond %{request_uri} !images/$ rewritecond %{request_uri} !index.php$ rewriterule ^(.*)$ "http://www.exmample.com" [r=301,l] 

currently images won't load unless specific call image ie:

rewritecond %{request_uri} !images/single/picture.jpg$ 

any thoughts or suggestions appreciated. cheers

yeah, "!images/$" means you're rewriting except specific request uri "http://www.example.com/images/". use regular expression in rewritecond:

rewritecond %{request_uri} !images/(.*)$ 

this means no uri starting "images/" rewritten. guess it'd safer along lines of "!images/(.*).jpg$" no uris starting "\images" , ending ".jpg" rewritten. refine needed, i.e. specifying multiple extensions ( (.jpe?g)|(.gif) ).

i'm no mod_rewrite wizard, , i'm not @ regex, approach worked me.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -