Skip to content

Instantly share code, notes, and snippets.

@yickson
Created July 22, 2018 23:56
Show Gist options
  • Save yickson/1b9e6042a94390983115f34a69134e8f to your computer and use it in GitHub Desktop.
Save yickson/1b9e6042a94390983115f34a69134e8f to your computer and use it in GitHub Desktop.
DirectoryIndex index.php
# Si esta mod_rewrite habilitado
<IfModule mod_rewrite.c>
# Activar modo de reescritura
RewriteEngine On
# Directorio de instalacion, puede ser necesario si
# la aplicacion se ubica en public_html
#RewriteBase /
# No permite reescritura si el archivo o directorio existe
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Para peticiones que no son archivos ni directorios
# Reescribe a index.php/
RewriteRule (.*) index.php/$1 [L]
# Reescribe a index.php?_url=URL
#RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^www\.midominio\.com$ [NC]
RewriteRule ^(.*)$ https://dominio.com/$1 [R=301,QSA,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment