. htaccess -检索PHP POST变量时出错


.HTACCESS - Error while retrieving PHP POST var

我有一些问题与PHP POST var和。htaccess文件。当我使用默认的。htaccess文件时,我无法从PHP检索任何POST信息。但是,当我删除一些行,我可以得到它。

我删除的行是从www到非www的重定向。

. htaccess:

<IfModule mod_rewrite.c>
    Options All -Indexes -MultiViews
    RewriteEngine On
    RewriteBase /
    # REDIRECIONAMENTO 301 DE WWW PARA NAO WWW
    RewriteCond %{HTTP_HOST} ^www'.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    # Paginas Principais
    RewriteRule ^/?$ index.php [NC,L]
    RewriteRule ^como-assistir/?$ como_assistir.php [NC,L]
    RewriteRule ^programas-uteis/?$ programas_uteis.php [NC,L]
    RewriteRule ^contato/?$ contato.php [NC,L]
    RewriteRule ^pedidos/?$ pedidos.php [NC,L]
    RewriteRule ^termos-de-uso/?$ termos_de_uso.php [NC,L]
    # NEVER CACHE
    <FilesMatch "'.(html|htm|php|cgi|pl)$">
        Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
    </FilesMatch>
</IfModule>

我删除的02行和POST的OK:

RewriteCond %{HTTP_HOST} ^www'.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

表单没问题,var_dump也没问题。问题出在。htaccess配置上。什么好主意吗?谢谢!

我发现一些主题有同样的问题:这是主题。

我刚刚添加了一行到我的。htaccess代码:

<IfModule mod_rewrite.c>
    Options All -Indexes -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_METHOD} !POST [NC]