简体   繁体   English

自定义php.ini和.htaccess中的重写器

[英]custom php.ini and rewriterule in .htaccess

I have a php application, which requires an .htaccess file with this rewriterule in it: 我有一个php应用程序,它需要一个带有以下重写器的.htaccess文件:

RewriteRule .* blog_manager/controller/frontController.php

I've opened a new hosting account and I wanted them to disable the extension: suhosin.mt_srand.ignore 我打开了一个新的托管帐户,希望他们禁用该扩展名:suhosin.mt_srand.ignore

for that they added the following lines to the .htaccess file, which are supposed to load a custom .ini file that disables that extension: 为此,他们在.htaccess文件中添加了以下几行,该行应该加载禁用该扩展名的自定义.ini文件:

AddHandler phpini-cgi .php
Action phpini-cgi /cgi-bin/php5-custom-ini.cgi

but then, I started getting 500 Internal server error... apparently, the rewriterule and the lines they added don't work together. 但是后来,我开始收到500内部服务器错误...显然,重写器和它们添加的行不能一起使用。

I've tried to disable that extension with ini_set() in the code and with php_flag/php_value in the htaccess file, but both failed. 我试图用代码中的ini_set()和htaccess文件中的php_flag / php_value禁用该扩展,但是都失败了。

does anybody know why is that? 有人知道为什么吗? Is there anything that can be done to allow the rewriterule and still disable that extension? 有什么办法可以允许重写器并仍然禁用该扩展?

Change your rule to this: 将规则更改为此:

RewriteCond %{REQUEST_URI} !/blog_manager/controller/frontController.php [NC]
RewriteRule ^ blog_manager/controller/frontController.php [L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM