php_value not allowed here,“RewriteEngine not allowed here” caused by htaccess in parent directory...

Currently I am using OSX Server (Yosemite) to host a bunch of PHP applications, some of which have a sub-directory under the websites document root for subdomains. Since updating to the Yosemite version of OSX Server, these subdomains have been throwing a 500 error with the error log referring to RewriteEngine not allowed here.

Investigating, I have confirmed that both the parent and subdomain sites have AllowOverride All configured, and .htaccess files are working on non-subdomain sites. Also, I have discovered that renaming or otherwise removing the .htaccess file from the parent directory causes the sub-domains to start working again.

/original_site_doc_root

.htaccess

index.php

...

subdomain/

.htaccess

index.php

...

Every bit of googling I do ends up referring to making sure mod_rewrite is installed and AllowOverride is configured properly.

My question is, how can I get Apache to stop throwing a 500 error on the sub-domain sites?

Edit

Here is the .htaccess file for the sub-domain that is causing me grief (with domains, directories and pages fuzzed to protect the innocent)

RewriteEngine On

Options +FollowSymlinks -Indexes

RewriteCond %{HTTP_HOST} ^www\.m\.somesite\.com$ [NC]

RewriteRule ^(.*)$ http://m.somesite.com/$1 [L,R=301]

RewriteBase /

# supress php errors

php_flag display_startup_errors off

php_flag display_errors off

php_flag html_errors off

php_value docref_root 0

php_value docref_ext 0

# enable PHP error logging

php_flag log_errors on

php_value error_log /some/fuzzed/dir

RewriteRule ^$ /index.php [L]

RewriteRule ^home$ /home.php [L]

RewriteRule ^some-page1$ /some-page1.php [L]

RewriteRule ^some-page2$ /some-page2.php [L]

RewriteRule ^some-page3/(.*)$ /some-page32.php [L]

RewriteRule ^some-page3(\/?)$ /some-page32.php [L]

RewriteRule ^some-page4/(.*)$ /some-page4.php [L]

RewriteRule ^some-page4(\/?)$ /some-page4.php [L]

RewriteRule ^some-page5/(.*)$ /some-page5.php [L]

RewriteRule ^some-page5(\/?)$ /some-page5.php [L]

RewriteRule ^some-page6/(.*)$ /some-page6.php [L]

RewriteRule ^some-page6(\/?)$ /some-page6.php [L]

The .htaccess for the parent directory/non-sub-domain-site is more or less similar, with the only real difference of relevance being the top 2 lines:

RewriteEngine On

Options +FollowSymlinks -Indexes -Multiviews

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值