DirectoryIndex index.php

<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>

RewriteEngine On

# Force HTTPS and non-www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.thrillsense\.com [NC]
RewriteRule ^(.*)$ https://thrillsense.com/$1 [L,R=301]

RewriteBase /

# XML sitemaps
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^news-sitemap\.xml$ news-sitemap.php [L]

# Redirect direct .php requests to extensionless URLs
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php(?:[\s?]|$) [NC]
RewriteRule ^ %1 [R=301,L]

# Redirect old singular overview URLs
RewriteRule ^article/?$ /articles [R=301,L]
RewriteRule ^guide/?$ /guides [R=301,L]

# Canonical overview pages
RewriteRule ^news/?$ latest.php [L]
RewriteRule ^articles/?$ articles.php [L]
RewriteRule ^guides/?$ guides.php [L]
RewriteRule ^blog/?$ blogs.php [L]
RewriteRule ^tickets/?$ ticket-and-offers-overview.php [L]
RewriteRule ^parks/?$ parks.php [L]
RewriteRule ^events/?$ events.php [L]

# Single posts
RewriteRule ^park/universal-uk/?$ universal-uk.php [L,QSA]
RewriteRule ^park/([^/]+)/?$ park.php?slug=$1 [L,QSA]
RewriteRule ^news/([^/]+)/?$ news.php?slug=$1 [L,QSA]
RewriteRule ^guide/([^/]+)/?$ guide.php?slug=$1 [L,QSA]
RewriteRule ^article/([^/]+)/?$ article.php?slug=$1 [L,QSA]
RewriteRule ^blog/([^/]+)/?$ post.php?slug=$1 [L,QSA]
RewriteRule ^event/([a-zA-Z0-9-]+)/?$ event.php?slug=$1 [L,QSA]
RewriteRule ^author/([a-zA-Z0-9-]+)/?$ author.php?slug=$1 [L,QSA]
RewriteRule ^tickets-offers/([^/]+)/?$ tickets-details.php?slug=$1 [L,QSA]
RewriteRule ^search/?$ search.php [L,QSA]

# Custom route
RewriteRule ^message/([0-9]+)/?$ view-message.php?id=$1 [L,QSA]

# Internal .php fallback for real PHP files
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L]

</IfModule>