[英]HTACCESS broke PHP code and the Xampp server
工作 450 小時后,我的網絡應用程序不再工作,我不知道如何解決。 我來解釋一下情況:
我正在將我的網站插入服務器並使用 htaccess。 我已經多次更改 htaccess 使用符號鏈接、重寫 url 以重定向到 https 等。
我的網站正在登錄用戶,現在不再使用此功能:
Apache 日志是這樣一個重復文件夾名稱的日志:
[13/Oct/2017:21:44:59 +0200] "GET /developement/index.php/fold/fold/fold/fold/fold/fold/loginform.inc.php HTTP/1.1" 302 9358 "-" "Mozilla/5.0 (Windows NT 6.2; WOW64; Trident/7.0; rv:11.0) like Gecko"
我剛剛在 Xampp inserting: AllowOverride All 中更改了 httpd.conf 后我發現它沒有
我真的不知道發生了什么:我想我的 php 有問題,我寫標題的地方: header("Location: ../invoice.php");
如果用戶正在登錄。
我讀過你不能在頭文件之前的 php 文件中有任何回聲,如果不是的話
更多信息:
我在所有文件中都包含了一個 core.php 文件,所以我定義了一些如下的函數:
<?
ob_start();//to use the header func to redirect to index.php after log in
session_name("test");//to hide session id def cookie name PHPSESSID=
session_start();//to save the global var user id after log in
//Errors On/off
if(strstr($_SERVER['SERVER_NAME'],"localhost")) {
// Make sure we show all errors
ini_set('display_errors', 1);
ini_set('log_errors', 1);
error_reporting(E_ALL);
ini_set('html_errors', 'On');
ini_set('display_startup_errors','On');
} else {
//IMP: DA VERIFICARE SE FUNZIONA NEL SERVER!!!!!!!!!!!!!!!!!!!
// We also want to suppress all warnings
ini_set('display_errors', 0);
error_reporting(0);
ini_set('html_errors', 'Off');
ini_set('display_startup_errors','Off');
}
//this to define links in my HTML (in header(Location: MIO./myfolder ) it does not work !!!)
//define http root
define("MINE",($_SERVER["SERVER_NAME"] == "localhost")? "http://localhost/developement/" : "https://www.mywebsite.it/");
//echo MINE;
?>
.htaccess 的內容:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^mywebsite.it [OR]
RewriteCond %{HTTP_HOST} ^www.mywebsite.it [NC]
RewriteRule ^(.*)$ https://www.mywebsite.it/$1 [L,R=301]
Xampp Apache 訪問日志:
::1 - - [15/Oct/2017:00:47:10 +0200] "POST /developement/elgin/loginform.inc.php HTTP/1.1" 200 10325 "http://localhost/developement/elgin/loginform.inc.php" "Mozilla/5.0 (Windows NT 6.2; WOW64; Trident/7.0; rv:11.0) like Gecko"
Xampp Apache 錯誤日志:
Failed loading C:\xampp\php\ext\php_xdebug-2.5.4-7.1-vc14.dll
6] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
只是一些 php 文件有 BOM。 保存到 BOM 並重新保存到 UTF-8 w no BOM
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.