# .htaccess Configuration # Version: 1.0 # Date: 2024-08-23 # Description: Initial version with domain redirection, PHP handling, and URL rewriting rules. #AddType application/x-httpd-php .html # Directory Options Options +FollowSymLinks -MultiViews # Enable Rewrite Engine RewriteEngine On RewriteBase / # ---- New Domain Redirection ---- # Redirect any version of the old domain to the new domain (HTTPS) RewriteCond %{HTTP_HOST} ^(www\.)?oldexample\.com$ [NC] RewriteRule ^(.*)$ https://www.newexample.com/$1 [L,R=301] # ---- Same Domain Redirection ---- # Redirect non-www to www on the same domain (HTTPS) RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} ^(.+)$ [NC] RewriteRule ^(.*)$ https://www.%1/$1 [L,R=301] # ---- index.html Redirection ---- RewriteCond %{THE_REQUEST} /\index\.html [NC] RewriteRule ^index\.html$ / [L,R=301] # ---- CSS/JS Versioning ---- RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L] # ---- 301 Specific URL Redirects ---- # Example: Redirect 301 /old-page.html /new-page.html Redirect 301 /old-page.html /new-page.html Redirect 301 /another-old-page.html /another-new-page.html