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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Squis
  • 921
  • 2
  • 8
  • 14
  • 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 '12 at 08: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 '12 at 22:12

0 Answers0