I've tried everything to get boost to work on my D7 sites but keep getting "Internal Server Error" when I put the code in the site's root .htaccess file. I used boost widely on D6 sites, but my servers are different now.

Here's a little more info in case it helps:

  • I've tried nearly every combination in /admin/config/system/boost/htaccess
  • I'm using a subdomain, so the site exists at subdomain.example.org
  • I can see files added to appropriate subdirectories in /cache/*
  • I've tried with and without "RewriteBase /"
  • I've tried with and without the alternate "Options +SymLinksIfOwnerMatch"
  • I've added "Options +SymLinksIfOwnerMatch" to cache/normal/example.org/.htaccess
  • Not sure whether PHP disable_functions has to do with this, but I've tried removing those temporarily without success

Lastly, perhaps this deserves a separate issue, but regarding the line at the bottom of /admin/config/system/boost/htaccess/generator:

"Note that the generated rules' settings can be configure (sic) at admin/config/development/performance/boost/htaccess-settings."

Based on the path, it would appear that this is a boost performance page, but it's identical to the Drupal performance page. Indeed, updating either one with different settings affects the other, yet the paths are different. So I'm confused about that, too.

Comments

michael.k’s picture

Anyone? I'm sorry but I just can't get this module to work.

bgm’s picture

Do you have access to your Apache error log? It should provide more information on the error.

Anonymous’s picture

What happens if you remove

cache/normal/example.org/.htaccess

and all other .htaccess files in the cache ?

AddDefaultCharset utf-8
FileETag MTime Size

are Apache 2.2 core directives, but maybe something is not right with the server configuration and it's not the root .htaccess causing the problems. Also +Symlinks is needed for mod_rewrite to work, take it out and you will get a 500 even with no symlinks on the server. You have the path to a generated cache file, so why not visit it directly and see if you still experience an error e.g. cache/normal/subdomain.example.org/node/1.html which you can get from the directory structure which may help eliminate some of the variables in debugging.

michael.k’s picture

Status: Active » Fixed

Thank you bgm and Philip_Clarke for your replies, both of which helped me to solve this issue.

I deleted all the .htaccess files that were in the site's cache directories (created upon saving at admin/config/system/boost/filesystem), but no change.

The error in the Apache error log gave me the critical clue:
~/.htaccess: RewriteCond: bad argument line '%{REQUEST_URI}'

Now, after a zillion cut-and-paste tests with .htaccess, I could zero in on the lines with %{REQUEST_URI}, which helped me realize that one long line was split! It turns out that pasting with nano forces soft returns for lines that exceed the shell's width, so long lines become broken code. One has to expand a window to a wide enough width to paste everything without modification.

So this line:

  RewriteCond %{REQUEST_URI} (^/(admin|boost_cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]

Became this:

  RewriteCond %{REQUEST_URI}
(^/(admin|boost_cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]

I am now happily seeing anonymous page requests build .htm files in the cache directories, and my performance increase is now simply awesome!

Many thanks for this module!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sco_tt’s picture

Thanks Michael, I was about 1/4 of a zillion cut and pastes using nano when I discovered your post!

sustainablesolutionsnz’s picture

What happens if you remove

cache/normal/example.org/.htaccess

This worked. It was driving me nuts, but now boost is finally working and server response according to pagespeed insights is 200ms faster.

Anonymous’s picture

...but the .htaccess files will regenerate (cron run, cache flush) at some point so the error needs to be diagnosed. It's most likely to be that the file needs FollowSymLinksIfOwnerMatch instead of Symlinks, which should be available in the dev version of boost.

sustainablesolutionsnz’s picture

Yup, found that out, and just figured out that it was the symlinks issue which i remedied and was about to post on.

sustainablesolutionsnz’s picture

At the risk of going off topic, I have changed symlinks to FollowSymLinksIfOwnerMatch in the problem htaccess file. Even with file permissions to 444, it is still being rewritten to to symlinks every few hours and giving error 500 for anonymous users. Any ideas?

Anonymous’s picture

the file needs FollowSymLinksIfOwnerMatch instead of Symlinks, which should be available in the dev version of boost.

if boost dev does not have the option, (4 quotes up) then I need to change the dev version.