Boost doesn't work for my frontpage(other pages work fine).I checked it for a long time,and found that the value of %{REQUEST_URI} in .htaccess is "/index.php" but not "/" on the frontpage,so the frontpage cann't redirect to _.html.
Does anybody know why? And how can I change the value from "/index.php" to "/"?

My webserver environments:
OS:Windows server 2012 standard
Apache version:2.4.3
PHP version:5.4.7
mod_rewrite:loaded

Please forgive my poor English.Thanks a lot.

Comments

Anonymous’s picture

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L]

Is the standard drupal .htaccess ruleset, so if / is not found then redirect is going to take place to /index.php. The boost rules should be before this block of code and if they are then the server is configured in some unusual way that appears to think that "/' is not a valid root folder. The permissions may be incorrect, there may be a directive somewhere in the configuration.

What does http://www.example.com do ? it should just display a page rather than redirect to http://www.example.com/ it appears that boost is working as designed and that it requires a look at your server configuration.

antims’s picture

Thank you,dear Philip_Clarke.
My .htaccess:

#
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(|~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
  Order allow,deny
</FilesMatch>

Options -Indexes

Options +FollowSymLinks

ErrorDocument 404 /index.php

DirectoryIndex index.php index.html index.htm

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_flag magic_quotes_gpc                 off
  php_flag magic_quotes_sybase              off
  php_flag register_globals                 off
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch \.php$>
    ExpiresActive Off
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]
  RewriteRule "(^|/)\." - [F]
   RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
   RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

 # RewriteBase /

    ### BOOST START ###

  # Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
  RewriteRule .* - [E=boostpath:normal]
  RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]
  RewriteCond %{HTTPS} on [OR]
  RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
  RewriteCond %{ENV:REDIRECT_STATUS} 200
  RewriteRule .* - [S=8]

  # GZIP
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=4]

  RewriteCond %{REQUEST_URI} ^/index.php$
  RewriteCond D:/webapp/htdocs/XXXXX/cache/%{ENV:boostpath}/XXXXX.cn/_%{QUERY_STRING}\.html -s 
  RewriteRule .* cache/%{ENV:boostpath}/XXXXX.cn/_%{QUERY_STRING}\.html [L,T=text/html,E=no-gzip:1]
  
   RewriteCond D:/webapp/htdocs/XXXXX/cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.html -s
  RewriteRule .* cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html,E=no-gzip:1]
  RewriteCond D:/webapp/htdocs/XXXXX/cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.xml -s
  RewriteRule .* cache/%{ENV:boostpath}/XXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.xml [L,T=text/xml,E=no-gzip:1]
  RewriteCond D:/webapp/htdocs/XXXXX/cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.json -s
  RewriteRule .* cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.json [L,T=text/javascript,E=no-gzip:1]

  # NORMAL
  RewriteCond D:\ebapp\htdocs\XXXXX\cache\%{ENV:boostpath}\XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}.html -s
  RewriteRule .* cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
  RewriteCond D:/webapp/htdocs/XXXXX/cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.xml -s
  RewriteRule .* cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.xml [L,T=text/xml]
  RewriteCond D:/webapp/htdocs/XXXXX/cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.json -s
  RewriteRule .* cache/%{ENV:boostpath}/XXXXX.cn%{REQUEST_URI}_%{QUERY_STRING}\.json [L,T=text/javascript]

  ### BOOST END ###



  # Pass all requests not referring directly to files in the filesystem to
  # index.php. Clean URLs are handled in drupal_environment_initialize().
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L]



  # Rules to correctly serve gzip compressed CSS and JS files.
  # Requires both mod_rewrite and mod_headers to be enabled.
  <IfModule mod_headers.c>
    # Serve gzip compressed CSS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

    # Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

    # Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>
antims’s picture

And apache's httpd.conf(For legibility,i deleted all commented lines):

ServerRoot "D:/webapp/apache"
Listen 80
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule status_module modules/mod_status.so
<IfModule !mpm_netware_module>
  <IfModule !mpm_winnt_module>
     User daemon
     Group daemon
  </IfModule>
</IfModule>
ServerAdmin postmaster@localhost

ServerName localhost:80

DocumentRoot "D:/webapp/htdocs"
<Directory />
    AllowOverride none
    Require all denied
</Directory>
AcceptFilter http none

<Directory "D:/webapp/htdocs">
     Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
       Require all granted
</Directory>
<IfModule dir_module>
    DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
                   default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
                   home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
<Files ".ht*">
	Require all denied
</Files>
ErrorLog "logs/error.log"
LogLevel warn

<IfModule log_config_module>
     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access.log" combined
</IfModule>

<IfModule alias_module>
     ScriptAlias /cgi-bin/ "D:/webapp/cgi-bin/"
</IfModule>

<IfModule cgid_module>
   </IfModule>
<Directory "D:/webapp/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>


<IfModule mime_module>
      TypesConfig "conf/mime.types"
       AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi .pl .asp
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

<IfModule mime_magic_module>
     MIMEMagicFile "conf/magic"
</IfModule>

Include "conf/extra/httpd-xampp.conf"
Include "conf/extra/httpd-mpm.conf"
Include "conf/extra/httpd-multilang-errordoc.conf"
Include "conf/extra/httpd-autoindex.conf"
Include "conf/extra/httpd-languages.conf"
Include "conf/extra/httpd-userdir.conf"
Include "conf/extra/httpd-info.conf"
Include "conf/extra/httpd-vhosts.conf"
Include "conf/extra/httpd-proxy.conf"
Include "conf/extra/httpd-default.conf"
Include "conf/extra/httpd-ssl.conf"
<IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
</IfModule>

<IfModule mod_proxy.c>
  <IfModule mod_proxy_ajp.c>
      Include "conf/extra/httpd-ajp.conf"
  </IfModule>
</IfModule>

<ifModule mod_deflate> 
  AddOutputFilterByType DEFLATE text/html text/xml application/x-httpd-php application/x-javascript text/css
</ifModule> 

<virtualhost XXX.XXX.XXX.XXX>
    ServerName  XXXXX.cn
    DocumentRoot "D:/webapp/htdocs/sa"
    <Directory "D:/webapp/htdocs/sa">
 #       Allow from all 
    </Directory>
</virtualhost>
Anonymous’s picture

A brief look and you should be investigating the function of dir_module which is not in the normal linux/ bsd based distributions and looks suspiciously where the problem may lie as it specifically handles directories and redirects to a list of defined pages.

antims’s picture

I tested Boost all night in different Windows OS(windows server 2003 32bit,windows server 2008 64bit,windows server 2012 64bit),3 servers with Intel Xeon CPU,all new installed Drupal 7.22 without any third party modules, and found that all _.html cann't be loaded on frontpage. It seems that Boost is compatible with the Windows platform or XAMPP1.8.2 not very well.

antims’s picture

This problem maybe caused by multilingual support. In the language settings,if I choose "Determine the language from the URL (Path prefix or domain)",the _.html can be loaded normally.I do not know why this is so.

Thank you,Philip_Clarke.
Best regards.

Anonymous’s picture

Status: Active » Closed (works as designed)

I know that the multilingual module does work on several sites including japanese and arabic ones, so I suggest asking over at their forum.

The other thing to do is to write a rewrite rule for index.php to _.html if the file exists.

antims’s picture

Is core localization module not multilingual module .