【发布时间】:2019-12-01 19:54:11
【问题描述】:
我的 NodeMCU 正在将数据保存到我的 Web 服务器(温度、湿度等),但是在我重写服务器前端和后端以使用 Symphony 框架后,即使我无法通过 HTTP 访问我的 API 文件在我的 .htaccess 中写入异常
我的.htaccess
RewriteEngine On
RewriteBase /vasek/home/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !.css
RewriteCond %{REQUEST_FILENAME} !.js
RewriteCond %{REQUEST_FILENAME} !api.php
RewriteRule (.*) index.php?url=$1 [QSA,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我希望访问我的服务器根文件夹中的 api.php 文件而不是得到这个
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://dev.steelants.cz/vasek/home/api.php">here</a>.</p>
<hr>
<address>Apache/2.4.25 (Debian) Server at dev.steelants.cz Port 80</address>
</body></html>
【问题讨论】:
-
最后一条规则导致了这个重定向。