Lofesa commented on issue #1897: 4xx status code, preventing rewriting URL: https://github.com/apache/incubator-pagespeed-mod/issues/1897#issuecomment-500205637 > Just a white page displaying "Internal Server Error" And no messages in the apache log? > > These directive cannot be used in .htaccess files or scopes. > > Then where am I supposed to put these directives for Apache? The documentation is so confusing > > Anyway, do I really need to do this if FetchHttps is enabled by default? Yes, you need it. You can put it in the "httpd.conf" (or "apache2.conf") file in a scope other than Directory , maybe in a vhost scope. In nginx you can put this in the http block or in the server block, but not in a location block. > > Can you try the LoadFromFile ? > > I tried but I failed :( > > Some of our images are generated dynamically so we can't load them from disk. example: > `RewriteRule ^image_mini/([^.]+)-00([0-9]+)\.jpg$ /image_mini_jpg.php?a=$2 [L,QSA,NC] ` > > > By default PageSpeed loads sub-resources via an HTTP fetch. It would be faster to load sub-resources directly from the filesystem, however this may not be safe to do because the sub-resources may be dynamically generated or the sub-resources may not be stored on the same server. But images are loaded from the same server? If yes, you can try some like that: pagespeed LoadFromFile "https://$host/" "$document_root/"; pagespeed LoadFromFileRuleMatch disallow .*; (This diables load any file) pagespeed LoadFromFileRuleMatch allow \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?$ps_dollar; (1) (And this enable load files with these extensions) (1).- Because Nginx uses the $-sign to indicate script variables, when you turn on ProcessScriptVariables you need to make a small change to any script-supporting commands that are using $. P.S: You are talking about puting directives in .httacces and this file is related to Apache server, but i see in the headers the server is nginx. Maybe you are using a nginx as a proxy cache? If not then the .httaccess does nothing in a nginx server.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services