[英]Mail.php doesn't work with .htaccess
我有一个问题,如果我将这个.htaccess代码放入,我的电子邮件php文件将无法正常工作
## Prevent directory listings
Options All -Indexes
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]
从发送带有表单的html文件到php文件的功能不起作用。 形式与邮政,然后在我有的PHP文件。
<?php
if(!isset($_POST["submit"]))
{
echo "error; you need to submit the form!";
}
$name = $_POST["name"];
$visitor_email = $_POST["visitor_email"];
$message = $_POST["message"];
此代码将不再起作用。 我用它来做客是因为用.htaccess重写了网址,
谢谢阅读
在RewriteBase
行下面插入此行,以忽略POST请求的重写规则:
RewriteCond %{REQUEST_METHOD} POST
RewriteRule ^ - [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.