Options -Indexes -MultiViews RewriteEngine On RewriteBase / # ---------------------------------------------------- # 1. Force Clean URLs (Remove .php) # ---------------------------------------------------- RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC] RewriteRule ^ /%1 [R=301,L] # ---------------------------------------------------- # 2. Skip existing files and directories # ---------------------------------------------------- RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] # ---------------------------------------------------- # 3. Map Clean URLs to PHP files safely # ---------------------------------------------------- RewriteCond %{DOCUMENT_ROOT}/$1.php -f RewriteRule ^(.*?)/?$ $1.php [L] # ---------------------------------------------------- # 4. Blog URLs # ---------------------------------------------------- RewriteRule ^blog/([a-zA-Z0-9-]+)/?$ blog_details.php?slug=$1 [L,QSA] # ---------------------------------------------------- # 5. Case Study URLs # ---------------------------------------------------- RewriteRule ^case_studies/([a-zA-Z0-9-]+)/?$ case_studies_detail.php?slug=$1 [L,QSA] # ---------------------------------------------------- # 6. Uploads # ---------------------------------------------------- RewriteRule ^uploads/(.*)$ admin/uploads/$1 [L] # ---------------------------------------------------- # 7. Services Catch-All # ---------------------------------------------------- RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9-]+)/?$ services_details.php?slug=$1 [L,QSA] # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php81” package as the default “PHP” programming language. AddHandler application/x-httpd-ea-php81 .php .php8 .phtml # php -- END cPanel-generated handler, do not edit