在服务器A上装了个Drupal 6.17,在服务器B上用nginx作反向代理,指向Drupal,结果出了很多莫名其妙的问题。网站放上去后无法访问,返回500错误。发现原来是.htaccess的问题。将.htaccess修改为只保留rewrite规则后,问题解决。但仍不死心。 继续追踪,发现原来是apahce里的AllowOverride配置有问题。 在A服务器,Drupal的Directory设置中,现为AllowOverride FileInto,改为AllowOverride All后,一切恢复正常。 PHP.net有说明。
How to change configuration settings7 r7 E& R5 _( ]! I4 X- P
I$ d: u8 R' s" qRunning PHP as an Apache module
( R& L: w% U) Q1 K# s; a
$ O7 F: r, i/ K+ Y. m; xWhen using PHP as an Apache module, you can also change the configuration settings using directives in Apache configuration files (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride Options" or "AllowOverride All" privileges to do so. Drupal sites/default/fiels目录上上传的图像无法显示。 通过URL直接访问,得到500错误,发现还来是.htaccess惹的祸。只要改AllowOverride All
国外设计欣赏论坛摘自:方医生798,谢谢!
|