繁体   English   中英

HTACCESS 破坏了 PHP 代码和 Xampp 服务器

[英]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.

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