Commit a166daba authored by David Libeau's avatar David Libeau

Fix index routing

parent c323d8a2
DirectoryIndex fedicore/app.php?q=index
RewriteEngine On
RewriteRule "^(.*)$" "fedicore/app.php?q=$1" [L,QSA]
\ No newline at end of file
<?php
require("autoload.php");
$logEnabled=true;
$serverEnv="dev";
require("autoload.php");
if(isset($_GET["q"]) && $_GET["q"]!=""){
if($logEnabled){
$headers = apache_request_headers();
$echolog="";
foreach ($headers as $header => $value) {
$echolog.="$header: $value\n";
}
file_put_contents("../fedilog/".date("d-m-Y").".txt",date("h:i:sa")." : ".$_SERVER["REQUEST_URI"]."\r".$echolog."\r",FILE_USE_INCLUDE_PATH | FILE_APPEND);
$q=$_GET["q"];
}else{
$q="index";
}
if($logEnabled){
$headers = apache_request_headers();
$echolog="";
foreach ($headers as $header => $value) {
$echolog.="$header: $value\n";
}
$core=new Core();
$core->welcome($_GET["q"]);
file_put_contents("../fedilog/".date("d-m-Y").".txt",date("h:i:sa")." : ".$_SERVER["REQUEST_URI"]."\r".$echolog."\r",FILE_USE_INCLUDE_PATH | FILE_APPEND);
}
$core=new Core();
$core->welcome($q);
?>
\ No newline at end of file
......@@ -11,8 +11,6 @@ class Core{
$query=explode("/",$query);
$qPos=0;
//.well-known/webfinger?resource=acct:david@fedi.blog
if($query[0]==".well-known"){
if($query[1]=="webfinger"){
if(isset($_GET["resource"]) && $_GET["resource"]!=""){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment