<?php


ob_start();
session_start();
session_regenerate_id();
require_once "_class/baglan.php";
require_once "_class/fonksiyon.php";
if (!file_exists("language/dil_" . $_SESSION["k_dil"] . ".php")) {
    exit("");
}
require_once "language/dil_" . $_SESSION["k_dil"] . ".php";
require_once "_class/seo.php";
if (durum == 0) {
    require tema . "/index.php";
} else {
    require tema . "/bakimda.php";
}
if ($htc["durum"] != 0) {
    $sorgu = $db->prepare("UPDATE sabit_url SET\r\n\t\t\tdurum\t= ?\r\n\t\t\tWHERE id = ?");
    $guncelle = $sorgu->execute([0, 1]);
    $db = NULL;
    $dt = fopen(".htaccess", "r+");
    fwrite($dt, "RewriteEngine on\r\nErrorDocument 404 /404.html");
    fwrite($dt, "\r\nRewriteRule ^([a-zA-Z0-9\\-_]+).html\$ index.php?sayfa=\$1 [L,QSA]\r\nRewriteRule ^([a-zA-Z0-9\\-_]+)(/?)\$ index.php?sayfa=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["sayfaurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["sayfaurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["sayfaurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["sayfaurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["ekibdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["ekibdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["ekibdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["ekibdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["haberdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["haberdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["haberdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["haberdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["refdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["refdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["refdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["refdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["fotodetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["fotodetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["fotodetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["fotodetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["videodetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["videodetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["videodetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["videodetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["refurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["refurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["refurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["refurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["belgeurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["belgeurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["belgeurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["belgeurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["dokumanurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["dokumanurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["dokumanurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["dokumanurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["ekiburl"] . "/(.*).html\$ index.php?sayfa=" . $htc["ekiburl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["ekiburl"] . "/(.*?)\$ index.php?sayfa=" . $htc["ekiburl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["hizmeturl"] . "/(.*).html\$ index.php?sayfa=" . $htc["hizmeturl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["hizmeturl"] . "/(.*?)\$ index.php?sayfa=" . $htc["hizmeturl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["hizmetdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["hizmetdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["hizmetdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["hizmetdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["birimurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["birimurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["birimurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["birimurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["birimdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["birimdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["birimdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["birimdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["kursurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["kursurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["kursurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["kursurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["kursdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["kursdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["kursdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["kursdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["musteriurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["musteriurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["musteriurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["musteriurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["fotourl"] . "/(.*).html\$ index.php?sayfa=" . $htc["fotourl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["fotourl"] . "/(.*?)\$ index.php?sayfa=" . $htc["fotourl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["videourl"] . "/(.*).html\$ index.php?sayfa=" . $htc["videourl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["videourl"] . "/(.*?)\$ index.php?sayfa=" . $htc["videourl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["haberurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["haberurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["haberurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["haberurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["yemekmenusuurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["yemekmenusuurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["yemekmenusuurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["yemekmenusuurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["etkinlikurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["etkinlikurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["etkinlikurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["etkinlikurl"] . "&s=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["etkinlikdetayurl"] . "/(.*).html\$ index.php?sayfa=" . $htc["etkinlikdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^" . $htc["etkinlikdetayurl"] . "/(.*?)\$ index.php?sayfa=" . $htc["etkinlikdetayurl"] . "&id=\$1 [L,QSA]\r\nRewriteRule ^sitemap.xml\$ sitemap.php [NC,L]");
    fclose($dt);
}
echo "\r\n";

?>