繁体   English   中英

Mail.php不适用于.htaccess

[英]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重写了网址,

  • 我该如何解决这个问题,以便我的php脚本可以运行
  • 并且文件目录受到保护,无法查看
  • 而且该php扩展名没有任何意义。

谢谢阅读

RewriteBase行下面插入此行,以忽略POST请求的重写规则:

RewriteCond %{REQUEST_METHOD} POST
RewriteRule ^ - [L]

暂无
暂无

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

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