Well... I figured it out!
It was a rewrite rule problem :| Some days ago I added a ^/ to the rewrite rules along with a xml extension to pass, because I'd like to serve a sitemap.xml to google sitemaps. Doing this screws up the downloads when ezpublish reaches the last / before the filename.
How can I serve a file called sitemap.xml from the root folder excluding it from being passed to index.php? I'm not really good with regexp... Max
Try to add a rewrite rule
RewriteRule ^sitemap\.xml$ - [L]
(which means: if the requested file is in the (rewrite-) root of the file and has the name sitemap.xml do not apply any rewriting to this page and skip all other rules that come after this one) before the rule which redirects everything to the index.php
Don't forget to add the filename to the list of files allowed in the allow from all section like this:
<FilesMatch "(^sitemap\.xml$)|(index\.php|\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf)$">
order allow,deny
allow from all
</FilesMatch>
Hi Claudia, thanks for your reply. It looks like it doesn't work. These are my current rewrite rules. I think it's because the file is located in the root folder, so ^/ doesn't get bypassed. Files which are stored at a deeper level work fine instead,but I cannot store sitemap.xml in an internal folder, it must reside at the root level.
RewriteEngine On
RewriteRule ^/sitemap\.xml$ - [L]
RewriteRule !(^/favicon.ico|^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf|htc)$ /index.php
I tried with/without trailing slash, almost every kind of combination, but I'm pretty clueless right now... I also tried to add it to my main rewrite rule, but the result is the same... Any idea?
Well this is weird! ^/robots.txt$ works as expected, it shows me a text file within the browser.
^/sitemap.xml$ gives an eZ module not found error instead...
I know that i can submit a tar-gzipped sitemap to google, I was just trying the thing, generating the sitemap by hand with a standalone software on my client. If I'll be able to get around this strange rewrite problem, I'm going to use sitemap_gen.py by google, with a cronjob to launch it automatically everyday.
Thanks a lot Xavier! I just didn't even think there was an extension to do this!
I installed "googlesitemaps", and created a virtual url within ez, so I didn't even have to copy sitemap.php in the root folder and modify the rewriterules.
It works like charm :) www.cpl.it/sitemap.xml
That's the url Massimo mention: http://ez.no/community/contribs/template_plugins/googlesitemaps_extension
I never took the time to test/use it, but I have the filling one can get a better indexing while using the priority tag.
I've often experienced than for rather short article body with a long intro, the parent node (the folder) is better indexed than the article pages itself and google tend to discard the article page as redondant.
By lowering the priority of the folders, I guess that you can change that and make the articles' pages more relevant.
If you're willing to experiment, you're more than welcome to share the results ;)