Fix: AI Blog Assistant retry logic and Subdomain routing for Akademi

This commit is contained in:
Muhammet Güler
2026-02-16 14:55:06 +03:00
parent 0fa8e4e435
commit 7101f7878a
10 changed files with 458 additions and 1 deletions
+40
View File
@@ -46,8 +46,48 @@ class PageController extends Controller
* Display a specific page by slug
*/
public function show($slug)
{
return $this->handleShow($slug);
}
/**
* Handle nested page routes (e.g. /kurumsal/hakkimizda)
*/
public function showNested($parentSlug, $slug)
{
return $this->handleShow($slug);
}
/**
* Handle akademi.truncgil.com.tr subdomain
*/
public function showAkademi()
{
return $this->handleShow('truncgil-akademi');
}
/**
* Unified show logic
*/
protected function handleShow($slug)
{
$settings = $this->getSettings();
// 3a. Akademi Sayfası Yönlendirmeleri
if ($slug === 'truncgil-akademi') {
$host = request()->getHost();
$path = request()->path();
// Eğer ana domainden geliyorsa -> Subdomain'e yönlendir
if ($host !== 'akademi.truncgil.com.tr') {
return redirect()->to('https://akademi.truncgil.com.tr/', 301);
}
// Eğer subdoman'de ama slug ile geliyorsa (/truncgil-akademi) -> Ana dizine yönlendir (/)
if ($host === 'akademi.truncgil.com.tr' && $path !== '/') {
return redirect()->to('https://akademi.truncgil.com.tr/', 301);
}
}
// 1. Statik View Kontrolü
if (view()->exists("templates.$slug")) {