Wednesday 13 October 2010 10:44:08 am
The suggested rewrite rule that comes with default eZP installation in .htaccess_root: RewriteRule !(\.(gif|jpe?g?|png|css|js|swf|html?)|var(.+)storage.pdf(.+)\.pdf)$ index.php
is not working properly. The problem is when you upload for example a .jpg image as an object of File class. The uploaded image can then be uploaded via an URL that goes like this: /content/download/7151474/29980970/version/1/file/mypic.jpg So because the URL ends with ".jpg", the it is not rewritten with index.php, and you get a 404 page. As a quickfix I made this change: RewriteRule !(design|var|share)/.*\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php
but this won't work if you have an eZ node with a path like this: /var/some_node.jpg Another idea is to have this rewrite rules: RewriteRule ^.*content/download/.*$ index.php
RewriteRule !*\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php
But this will not work for static images URLs like this: /design/content/download/some_image.jpg Also a change to this last rule: RewriteRule ^content/download/.*$ index.php
RewriteRule !*\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php
that matches only URLs that begin with "content/download" won't work because if you have multiple siteacces, it won't rewrite the URLs that begin with the siteaccess name. I'll think about this further, but... Anyone already has a better idea? Can we get a rewrite rule that will work for all the cases?
--
Nothing is impossible. Not if you can imagine it!
Hubert Farnsworth
|