# ============================================================================
# AI Visibility module — .htaccess additions for EACH public domain docroot
# ----------------------------------------------------------------------------
# MERGE these lines into the existing .htaccess (create one if missing).
# Put the rules AFTER any existing "RewriteEngine On" line — do not remove
# or reorder existing rules.
# ============================================================================

RewriteEngine On

# /sitemap.xml is now generated live (15-min cached) from the stock list.
# IMPORTANT on bad-credit-car.finance: rename the old static sitemap.xml to
# sitemap-static.xml first (it gets merged into the dynamic one automatically).
RewriteRule ^sitemap\.xml$ sitemap.php [L]

# Pretty car URLs:  /cars/123-2015-audi-q3  →  cars/car.php?id=123
RewriteRule ^cars/?$ cars/index.php [L]
RewriteRule ^cars/([0-9]+)(?:-[a-z0-9-]*)?/?$ cars/car.php?id=$1 [L,QSA]

# Never serve the sitemap cache file directly
RewriteRule ^cache/ - [F,L]
