Skip to content

Instantly share code, notes, and snippets.

@maagmirror
Created June 10, 2017 15:25
Show Gist options
  • Save maagmirror/ab7cb7d5c11b640009154026c03d6608 to your computer and use it in GitHub Desktop.
Save maagmirror/ab7cb7d5c11b640009154026c03d6608 to your computer and use it in GitHub Desktop.
# Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working
RewriteBase /
Options +FollowSymLinks
# Quitar el www del nombre de dominio
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.maag\.xyz$ [NC]
RewriteRule ^(.*)$ https://maag.xyz/$1 [R=301,QSA,L]
</IfModule>
#Quita extensiones .php
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]
#Forzar ssl en toda la web
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://maag.xyz/$1 [R,L]
</IfModule>
Options +FollowSymLinks
RewriteEngine On
#Redireccion 404
Options All -Indexes
ErrorDocument 404 http://maag.xyz/404/
ErrorDocument 400 http://maag.xyz/404/
ErrorDocument 401 http://maag.xyz/404/
ErrorDocument 403 http://maag.xyz/404/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment