以下htaccess规则有什么问题

时间:2015-07-22 06:38:42

标签: regex .htaccess mod-rewrite zend-framework

您好我有一个惊人的(?)工作来修复网站上的错误。这是一个HTTP 500错误。 它是由htaccess文件引起的。但我无法弄清楚代码有什么问题。这是代码。

# Use PHP5 Single php.ini as default
#AddHandler application/x-httpd-php5s .php


# The rules below basically say that if the file exists in the tree, just
# serve it; otherwise, go to index.php. This is more future-proof for your
# site, because if you start adding more and more content types, you don't
# need to alter the .htaccess to accomodate them.
# This is an important concept for the Front Controller Pattern which the
# ZF MVC makes use of.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ public/index.php [NC,L]
Redirect 301 /platforms/mt4-ecn http://example.com/
Redirect 301 /partnerships/mt4-to-mt4-bridge http://example.com/

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/aaaecn/public_html 
</IfModule>
<Files php.ini> 
order allow,deny 
deny from all 
</Files>

这个重定向规则适用于zend框架,但我没有任何使用该框架的经验。

我对所有行进行了评论,现在尝试修复了500错误。所以我通过取消注释将其过滤掉了。

  

RewriteRule ^。* $ - [NC,L]

此行导致错误,但删除此行会导致无效重定向和404错误。我该怎么做才能解决这个问题。

1 个答案:

答案 0 :(得分:1)

尝试这样的规则:

$username = "mydomain\localdmin"
$password = "Passw0rd"
$AdminCred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
$regFile = "\\myServer\myShare\myRegFile.reg"
$regArg1 = "import $regFile"

Start-Process reg.exe -ArgumentList $regArg1 -Credential $AdminCred