# =====================================================================
# Full .htaccess for sketchure.com (production)
# - Keeps your existing LiteSpeed + WordPress directives
# - Adds HTTPS + host canonicalization (non-www)
# - Normalizes trailing slashes on clean URLs
# - Implements all Services + Portfolio→Projects + Pages redirects
# =====================================================================

# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule LiteSpeed>
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
RewriteRule litespeed/debug/.*\.log$ - [F,L]
RewriteRule \.litespeed_conf\.dat - [F,L]

### marker ASYNC start ###
RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
RewriteCond %{QUERY_STRING} action=async_litespeed
RewriteRule .* - [E=noabort:1]
### marker ASYNC end ###

### marker MOBILE start ###
RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]
### marker MOBILE end ###

### marker WEBP start ###
RewriteCond %{HTTP_ACCEPT} image/webp [OR]
RewriteCond %{HTTP_USER_AGENT} iPhone\ OS\ (1[4-9]|[2-9][0-9]) [OR]
RewriteCond %{HTTP_USER_AGENT} Firefox/([6-9][0-9]|[1-9][0-9]{2,})
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
### marker WEBP end ###

### marker DROPQS start ###
CacheKeyModify -qs:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga
### marker DROPQS end ###

</IfModule>
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END LSCACHE

# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
### marker BROWSER CACHE start ###
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/pdf A31557600
ExpiresByType image/x-icon A31557600
ExpiresByType image/vnd.microsoft.icon A31557600
ExpiresByType image/svg+xml A31557600

ExpiresByType image/jpg A31557600
ExpiresByType image/jpeg A31557600
ExpiresByType image/png A31557600
ExpiresByType image/gif A31557600
ExpiresByType image/webp A31557600
ExpiresByType image/avif A31557600

ExpiresByType video/ogg A31557600
ExpiresByType audio/ogg A31557600
ExpiresByType video/mp4 A31557600
ExpiresByType video/webm A31557600

ExpiresByType text/css A31557600
ExpiresByType text/javascript A31557600
ExpiresByType application/javascript A31557600
ExpiresByType application/x-javascript A31557600

ExpiresByType application/x-font-ttf A31557600
ExpiresByType application/x-font-woff A31557600
ExpiresByType application/font-woff A31557600
ExpiresByType application/font-woff2 A31557600
ExpiresByType application/vnd.ms-fontobject A31557600
ExpiresByType font/ttf A31557600
ExpiresByType font/otf A31557600
ExpiresByType font/woff A31557600
ExpiresByType font/woff2 A31557600
</IfModule>
### marker BROWSER CACHE end ###
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE

# =====================================================================
# >>>>>> START: SEO + REDIRECTS (place above WordPress) <<<<<<
# =====================================================================

# -----------------------------
# Canonical: HTTPS + non-www
# -----------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^www\.sketchure\.com$ [NC]
RewriteRule ^(.*)$ https://sketchure.com/$1 [R=301,L]
</IfModule>

# ---------------------------------------------
# Trailing slash normalization for clean URLs
# (keeps files and extensions untouched)
# ---------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.[A-Za-z0-9]{1,5}$
RewriteRule ^(.+[^/])$ https://sketchure.com/$1/ [R=301,L]
</IfModule>


############################################
# BLOG → INSIGHTS (fallbacks, non-careers)
############################################

# Blog index → Insights index
Redirect 301 /blog/ https://sketchure.com/insights/

# Fallback: any other old /blog/{slug} → Insights index
RedirectMatch 301 ^/blog/[^/]+/?$ https://sketchure.com/insights/

# Retired non-career posts → Insights index
RedirectMatch 301 ^/(5-things-that-take-a-room-from-good-to-great|how-to-make-a-huge-impact-with-multiples|our-favorite-home-decor-trends-of-the-year|clever-architectural-details-keep-an-apartment-looking-sleek-and-symmetrical|the-5-secrets-to-pulling-off-simple-minimal-design|retail-design-for-different-market-segments|9-steps-to-choosing-an-interior-design-company|the-psychology-of-retail-interior-design|guide-to-commercial-interior-design|the-impact-of-lighting-in-residential-interior-design|2024-a-milestone-year-for-sketchure)/?$ https://sketchure.com/insights/



############################################
# CAREERS (new module) – precise mappings
############################################

# Careers hub (replace earlier mapping to /who-we-are/)
Redirect 301 /jobs-and-careers-at-sketchure/ https://sketchure.com/careers/
Redirect 301 /jobs-careers/ https://sketchure.com/careers/
# Individual roles → new careers slugs
Redirect 301 /architect-team-lead/ https://sketchure.com/careers/architect-team-lead/
Redirect 301 /senior-business-development-engineer/ https://sketchure.com/careers/senior-business-development-engineer/
# Old long slug → closest role (title match beats “fit-out” phrase)
Redirect 301 /senior-procurement-estimation-engineer-fit-out-high-end-finishes-sector/ https://sketchure.com/careers/senior-procurement-estimation-engineer/
# (If you prefer to map that one to the fit-out role instead, use:)
# Redirect 301 /senior-procurement-estimation-engineer-fit-out-high-end-finishes-sector/ https://sketchure.com/careers/senior-site-engineer-fit-out-high-end-finishes/




# ---------------------------------------------
# SERVICES (only where slugs changed)
# ---------------------------------------------
Redirect 301 /service/retail-restaurant-design/ https://sketchure.com/service/retail-interior-design/
Redirect 301 /service/landscape-design-services/ https://sketchure.com/service/landscape-design/
Redirect 301 /service/finishing-execution/ https://sketchure.com/service/project-management/
# Optional: collapse accidental /services/ → /service/
# RedirectMatch 301 ^/services/(.*)$ https://sketchure.com/service/$1

# ---------------------------------------------
# PAGES (site-wide)
# ---------------------------------------------
# About → Who we are
Redirect 301 /sketchure/ https://sketchure.com/who-we-are/
# Old services hubs → What we do
Redirect 301 /interior-design-services/ https://sketchure.com/what-we-do/
Redirect 301 /services-list/ https://sketchure.com/what-we-do/

# ---------------------------------------------
# PORTFOLIO → PROJECTS
# ---------------------------------------------
# Index
Redirect 301 /portfolio/ https://sketchure.com/projects/

# One-to-one (exact or best-match)
Redirect 301 /portfolio/villa-marassi-design-and-furniture/ https://sketchure.com/projects/villa-marassi/
Redirect 301 /portfolio/roxi/ https://sketchure.com/projects/studio-dreamland/
Redirect 301 /portfolio/landscape-fifth-settlement/ https://sketchure.com/projects/landscape-dreamland/
Redirect 301 /portfolio/office-design/ https://sketchure.com/projects/zf-holding-office/
Redirect 301 /portfolio/studio-dreamland/ https://sketchure.com/projects/studio-dreamland/
Redirect 301 /portfolio/3d-max/ https://sketchure.com/projects/
Redirect 301 /portfolio/residential-220m2-lebnan-square-el-mohandsen/ https://sketchure.com/projects/apt-lebanon-sq/
Redirect 301 /portfolio/residential-villa-design-in-al-sheikh-zayed/ https://sketchure.com/projects/villa-elsheikh-zayed/
Redirect 301 /portfolio/residential-interior-design-zayed-dunes-apartment-in-al-sheikh-zayed/ https://sketchure.com/projects/apt-zayed-dunes/
Redirect 301 /portfolio/almaza/ https://sketchure.com/projects/villa-marassi/
Redirect 301 /portfolio/childrenroom/ https://sketchure.com/projects/apt-lebanon-sq/
Redirect 301 /portfolio/unipaknile-factory/ https://sketchure.com/projects/unipaknile-factory/
Redirect 301 /portfolio/lufthansa-wtc-office/ https://sketchure.com/projects/lufthansa-cairo-hq/
Redirect 301 /portfolio/lufthansa-airport-office/ https://sketchure.com/projects/lufthansa-airport-office/
Redirect 301 /portfolio/european-union/ https://sketchure.com/projects/european-union/
Redirect 301 /portfolio/the-emirates-group/ https://sketchure.com/projects/the-emirates-group-cairo-office/
Redirect 301 /portfolio/world-food-programme/ https://sketchure.com/projects/un-world-food-programme/
Redirect 301 /portfolio/chanel/ https://sketchure.com/projects/guerlain/
Redirect 301 /portfolio/guerlain/ https://sketchure.com/projects/guerlain/
Redirect 301 /portfolio/debenhams-2/ https://sketchure.com/projects/debenhams-dior-booth/
Redirect 301 /portfolio/roh-alkahera/ https://sketchure.com/projects/roh-alkahera-restaurant/
Redirect 301 /portfolio/kempinski/ https://sketchure.com/projects/kempinski-soma-bay/
Redirect 301 /portfolio/guangzhou/ https://sketchure.com/projects/guangzhou-office/
Redirect 301 /portfolio/save-the-children/ https://sketchure.com/projects/save-the-children/
Redirect 301 /portfolio/arab-african-international-bank/ https://sketchure.com/projects/arab-african-international-bank/
Redirect 301 /portfolio/unimar/ https://sketchure.com/projects/unimar/

# Catch-all for any other single-slice portfolio slugs (use if needed)
RedirectMatch 301 ^/portfolio/[^/]+/?$ https://sketchure.com/projects/

# Normalize /projects items missing trailing slash (if your CMS expects /)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/projects/[^/]+$ [NC]
RewriteRule ^projects/(.+)$ https://sketchure.com/projects/$1/ [R=301,L]
</IfModule>

# =====================================================================
# >>>>>> END: SEO + REDIRECTS <<<<<<
# =====================================================================

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
   php_flag display_errors Off
   php_value max_execution_time 350
   php_value max_input_time 300
   php_value max_input_vars 3000
   php_value memory_limit 256M
   php_value post_max_size 64M
   php_value session.gc_maxlifetime 2440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php83"
   php_value upload_max_filesize 64M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 350
   php_value max_input_time 300
   php_value max_input_vars 3000
   php_value memory_limit 256M
   php_value post_max_size 64M
   php_value session.gc_maxlifetime 2440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php83"
   php_value upload_max_filesize 64M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php83” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
