chagitqskjdlqskdmslkqdj
chatjkqsdjlqskdjqslkdjkslqd
azekzkjeqksldjlqsjdlsqd
xqlqkzdjlqsdklqsdkslqd
🏃‍♀️👁️👁️🏃‍♀️# ===========================================
# .htaccess Generated for: https://metabolomicstraining.org
# ===========================================
# This file handles:
# 1) Force HTTPS + non-www (single-hop)
# 2) Remove /index.php, /index.html, /index.htm (single-hop)
# 3) Remove trailing slash on non-directories
# 4) Redirect 404 errors to home page (SEO-friendly)
# ===========================================

RewriteEngine On

# -----------------------------------------
# 1) Force HTTPS + non-www in a single redirect
# -----------------------------------------
# If request is HTTP OR starts with www, redirect to https://metabolomicstraining.org
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteRule ^ https://metabolomicstraining.org%{REQUEST_URI} [R=301,L]

# -----------------------------------------
# 2) Remove index.php / index.html / index.htm (single-hop)
# -----------------------------------------
# External redirect: strip /index.php, /index.html, /index.htm from URL
RewriteCond %{THE_REQUEST} /index.(php|html|htm)(?|s|$) [NC]
RewriteRule ^(.*)index.(php|html|htm)$ /$1 [R=301,L]

# -----------------------------------------
# 3) Remove trailing slash on non-directories
# -----------------------------------------
# If not a real directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

# -----------------------------------------
# 4) 404 Not Found _ Redirect to Home (SEO-friendly)
# -----------------------------------------
# Uses 302 (temporary) redirect to avoid "soft 404" penalties
# Search engines treat 302 as: "page not found, check home instead"
# A 301 here would incorrectly signal that ALL missing pages = home page
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ https://metabolomicstraining.org/ [R=302,L]

# ===========================================
# End of .htaccess rules
# ===========================================