zapcode

front_controller

Aug 29th, 2019 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. # ----- ACTIVATE REWRITE MOD -----
  2. RewriteEngine On
  3.  
  4. #------- REDIRECCIÓN HTTPS Y WWW A NO WWW -----------------------
  5.  
  6. # ---- to non-www in LOCALHOST
  7. RewriteCond %{HTTPS} off
  8. RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  9. RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
  10. # ---- to non-www in PRODUCTION
  11. RewriteCond %{HTTPS} on
  12. RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  13. RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
  14.  
  15. #------- REDIRECT TO HTTPS ONLY IN .COM PRODUCTION DOMAIN
  16. RewriteCond %{HTTP_HOST} ^(.*)\.com$ [NC]
  17. RewriteCond %{HTTPS} !on
  18. RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  19.  
  20. # ------ FRONT CONTROLLER -----
  21. RewriteCond %{REQUEST_FILENAME} !-d
  22. RewriteCond %{REQUEST_FILENAME} !-f
  23.  
  24. # ------ URI in GET -----
  25. RewriteRule ^(.*)$ /?url=$1 [QSA]
  26.  
Add Comment
Please, Sign In to add comment