Why do I see an underscore at the end of each file name - like "Bla_.html" and "AAAA_.html" ?

Comments

mikeytown2’s picture

Status: Active » Closed (fixed)

Has to do with the trick to get the rewrite rules down to just 1 naming convention for all urls; dirs, normal & query strings.

Old

  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/index.html -f
  RewriteRule ^(.*)$ cache/%{SERVER_NAME}/index.html [L]

  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI} -d
  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}/index.html -f
  RewriteRule ^(.*)$ cache/%{SERVER_NAME}/$1/index.html [L]

  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}.html -f
  RewriteRule ^(.*)$ cache/%{SERVER_NAME}/$1.html [L]

  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html -f
  RewriteRule ^(.*)$ cache/%{SERVER_NAME}/$1_%{QUERY_STRING}.html [L]

New

  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]

Makes porting the code to things like nginx & lighttpd simpler. Also with the simplifyed syntax it makes supporting other things besides html easier. Boost now serves/caches 5 types of content: html, xml, css, js, & json.