[Drupal] Boost 造成 admin_menu消失及表單無法提交等問題

 

雖然D8也現世很久了,但最近才把一個老舊的網站從 D6 升級到 D7,除了一些模組衝突問題之外,升級大致上還算順利。

一個全心安裝的Boost,一切運作正常,

但只要是已登入的使用者,admin_menu會消失,然後從瀏覽器的開發者工具發現是某一段js找不到,原本想說就算了,頂多不要用...

然後接著就發現node/*/edit的表單無法更新@@,跟著就注意到,其實是所有的表單都無法提交(不過實際上應該是有提交成功,但我們只看得到舊畫面)
所以還是得要解決問題。

後來找到有人碰到類似的狀況,原來是Apache版本比較老舊,新版boost(此時安裝的版本是7.x-1.2)產出的.htaccess 是造成問題的主因

得要用boost 7.x-1.0 所產生的.htaccess 
備份如下,以供有需求的人使用,附帶一題,我沒有照文章中所說的,模組也改為 bootstrap 7.x-1.0 ,而是依舊用較新的版本,目前運作看起來暫時沒什麼問題產生

### BOOST START ###

# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]

# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
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=3]

# GZIP
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=1]
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html,E=no-gzip:1]

# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]

### BOOST END ###