Forums / Setup & design / open pdf file in browser window

open pdf file in browser window

Author Message

andre müller

Tuesday 15 January 2008 6:51:15 am

hello
i try to create a link to pdf file in the media section. the pdf file should be opened in a browser window. i managed to make the link work with: {$relateditem.data_map.file.content.filepath|ezroot()}, but this only works if i remove my .htaccess file.
can anybody help me with altering the .htaccess file so users can view pdf's. or even better: is there a better way to have users read pdf directly without downloading? thanks..

André R.

Tuesday 15 January 2008 12:33:51 pm

You should probably post the rewrite conditions / rules you use in you .htaccess file..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

andre müller

Wednesday 16 January 2008 1:53:29 am

the commented-out lines are the original entries from a fresh install

#<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf)$">
<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html|pdf))$">
order allow,deny
allow from all
</FilesMatch>

and:

#RewriteRule !\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php
RewriteRule !\.(gif|jpe?g|png|css|js|html|pdf)$ index.php

with that it works, but i'm not really sure what it's exactly doing..is it allowing all pdfs to be accessed and not to be redirected to index.php? are there problems with that?

i think my problem is, that my pdf files are not in in a path that includes a pdf directory. they are in a folder called application..