0

I might be doing something wrong but when I deploy symfony project to remove /web/ part from the URL i use .htaccess file:

RewriteEngine on
RewriteBase /web/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]

And because of that I need to add web/ to all assets like css files js files images. but when I add it to the images where I use LiipImagineBundle to generate thumbs URL generated for them becomes:

http://example.com/media/cache/resolve/thumb_263x140/web/uploads/mainPhotos/ae34833f0ffe84437e6688f4588771f981bb4408.jpeg

and instead of that I need: http://example.com/web/media/cache/resolve/thumb_263x140/uploads/mainPhotos/ae34833f0ffe84437e6688f4588771f981bb4408.jpeg

code for first URL is {{ ('web/uploads/mainPhotos/' ~ article.path)| imagine_filter('thumb_263x140') }}

if I try to add web/ part before {{ ...... }} like that src="web/{{ ('uploads/mainPhotos/' ~ article.path)| imagine_filter('thumb_263x140') }}" I get URL http://example.com/web/http://test4.einius.lt/media/cache/thumb_263x140/uploads/mainPhotos/ae34833f0ffe84437e6688f4588771f981bb4408.jpeg

How do I achieve the right URL?

Einius
  • 1,352
  • 2
  • 20
  • 45
  • 1
    You shouldn't be removing the "web" using .htaccess. Just point the WebRoot to web folder. Nothing outside "web" directory should be accessible to public. – Igor Pantović Sep 27 '14 at 16:38
  • Thanks. I thought that it should be the other way to do that. That was exactly what I needed to change WebRoot in .htaccess file. – Einius Sep 28 '14 at 14:20

0 Answers0