我已经启用mod_rewrite并且正在使用一个.htaccess文件来传递所有请求index.php。
如果我访问 URL
http://localhost/mysite
http://localhost/mysite/abc
页面加载一次。
但是,如果我在路径中添加额外的部分,页面会加载 3 次,并且我的 css 文件不会被包含在内:
http://localhost/mysite/abc/xyz
http://localhost/mysite/abc/xyz/ttt
ETC...
所有这些都会导致页面加载 3 次。我可以看到这一点,因为我index.php在Eclipse中设置了断点。
这是我的.htaccess文件:
<IfModule mod_rewrite.c>
  RewriteEngine on
  # Block access to "hidden" directories whose names begin with a period. 
  # Files whose names begin with a period are protected by the FilesMatch directive
  # above.
  RewriteRule "(^|/)\." - [F]
  # 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
  RewriteRule ^ index.php [L]
</IfModule>
任何想法为什么页面被多次加载并且缺少css?