0

I'm transitioning my website to Silex (first time working with a framework), but the images aren't showing up.

This is my .htaccess:

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

All requests are caught and sent to index.php, including all files that are supposed to be available to the visitor (images, stylesheets and javascripts). What do I need to do to make them available?

As for hotlinking, I've been adding a watermark by adding this line to the .htaccess:

RewriteRule ^(.*\.png)$ /hotlink.php?fn=$1 [L]

Whenever a .png file is requested, hotlink.php applies a watermark and sends it on its way (code courtesy of http://www.chipple.net/mt/2006/11/04_003858.php).

How do I get this to work with Silex?

2
  • 1
    The RewriteCond rule checks if a file exists otherwise it passes it on to index.php. Is your rule for the hotlinking above that condition?
    – gunnx
    Aug 10, 2012 at 8:10
  • Oooooh... okay, yeah that makes sense. After reading up about mod_rewrite syntax, I've gotten a better understanding of how things work. After trying it again, the images now appear. Dunno why they didn't before. Haven't gotten to the hotlink prevention yet.
    – Squis
    Aug 11, 2012 at 22:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.