<?php

namespace App\Controllers;

class Robots extends BaseController
{
    public function index()
    {
        $this->response->setContentType('text/plain');

        $content = "User-agent: *\n";
        $content .= "Disallow: /admin/\n";
        $content .= "Disallow: /system/\n";
        $content .= "Disallow: /writable/\n\n";
        
        $content .= "Allow: /public/assets/\n";
        $content .= "Allow: /public/uploads/\n\n";

        $content .= "Sitemap: " . base_url('sitemap.xml') . "\n";

        return $content;
    }
}
