feat(seo): add SEO controller for robots.txt and sitemap.xml

- Implemented SeoController with methods for serving robots.txt and sitemap.xml.
- Updated robots.txt logic to disallow access to /admin and /api paths.
- Enhanced meta tags and Open Graph data in home.html.twig for better SEO.
- Added X-Robots-Tag header in SecurityHeadersSubscriber for /admin and /api routes.
This commit is contained in:
hamed
2026-06-28 22:28:07 +03:30
parent 89451e8d3b
commit 1bf9035f5f
10 changed files with 2368 additions and 1920 deletions
@@ -29,6 +29,10 @@ class SecurityHeadersSubscriber implements EventSubscriberInterface
if (str_starts_with($path, '/api') && !str_starts_with($path, '/api/doc')) {
$response->headers->set('Content-Security-Policy', "default-src 'none'");
}
if (str_starts_with($path, '/admin') || str_starts_with($path, '/api')) {
$response->headers->set('X-Robots-Tag', 'noindex, nofollow');
}
}
public static function getSubscribedEvents(): array