RewriteEngine on

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Forzar HTTPS (Redirige de HTTP a HTTPS)
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L,NE]
RewriteBase /shiba/

ErrorDocument 404 /index.php
ErrorDocument 403 /index.php

AddDefaultCharset UTF-8

RewriteRule ^blog/([A-Za-z0-9_-]+)/([0-9]+)$ blog.php?url=$1&id_detalle=$2 [L,QSA]
RewriteRule ^detalle/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ detalle.php?url=$1&id=$2 [L,QSA]

RewriteRule ^tienda/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ tienda.php?url=$1&id=$2 [L,QSA]
RewriteRule ^tienda/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ tienda.php?url=$1&id=$2&id2=$3 [L,QSA]

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript

# Para quitar la extensión de los archivos (.php)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]

# php -- BEGIN cPanel-generated handler, do not edit
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit