Guest User

Untitled

a guest
Feb 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. If (SITE A DOMAIN or SITE A SUBDOMAIN) {
  2. Rewrite this specific way -> /index.php/$1
  3. } else {
  4. Rewrite this specific way -> /directory/www/index.php/$1
  5. }
  6.  
  7. RewriteEngine on
  8. RewriteCond %{REQUEST_FILENAME} !-f
  9. RewriteCond %{REQUEST_FILENAME} !-d
  10. RewriteCond $1 !^(index.php|blog)
  11.  
  12. RewriteCond %{HTTP_HOST} ^subdomain.example.com$ [NC,OR]
  13. RewriteCond %{HTTP_HOST} ^ example.com$
  14. RewriteRule .? - [S=1]
  15. RewriteRule ^(.*)$ /directory/www/index.php/$1 [L]
  16. RewriteRule .? - [S=1]
  17. RewriteRule ^(.*)$ /index.php/$1 [L]
  18.  
  19. # If (SITE A DOMAIN or SITE A SUBDOMAIN)
  20. RewriteCond %{HTTP_HOST} ^subdomain.example.com$ [NC,OR]
  21. RewriteCond %{HTTP_HOST} ^example.com$ [NC]
  22. # make sure we haven't already rewritten this URI
  23. RewriteCond %{REQUEST_URI} !/directory/www/index.php
  24. # don't rewrite if the resource already exists
  25. RewriteCond %{REQUEST_FILENAME} !-f
  26. RewriteCond %{REQUEST_FILENAME} !-d
  27. # rewrite
  28. RewriteRule ^(.*)$ /directory/www/index.php/$1 [L]
  29.  
  30. # IF !(SITE A DOMAIN or SITE A SUBDOMAIN)
  31. RewriteCond %{HTTP_HOST} !^subdomain.example.com$ [NC]
  32. RewriteCond %{HTTP_HOST} !^example.com$ [NC]
  33. # make sure we haven't already rewritten this URI
  34. RewriteCond %{REQUEST_URI} !/index.php
  35. # don't rewrite if the resource already exists
  36. RewriteCond %{REQUEST_FILENAME} !-f
  37. RewriteCond %{REQUEST_FILENAME} !-d
  38. # rewrite
  39. RewriteRule ^(.*)$ /index.php/$1 [L]
  40.  
  41. RewriteEngine on
  42. RewriteCond %{HTTPS} !=on
  43. #RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  44. #RewriteCond %{HTTP_HOST} ^example.com [NC]
  45. RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC]
  46. #RewriteCond %{HTTPS} off
  47. # Only redirect to https if the main domain (no subdomain) is matched
  48. # case-insensitively in HTTP_HOST
  49. #RewriteCond %{HTTP_HOST} ^example.com$ [NC]
  50. # added flags...
  51. #RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  52. RewriteCond $1 !^(index.php|resources|robots.txt)
  53. RewriteCond %{REQUEST_FILENAME} !-f
  54. RewriteCond %{REQUEST_FILENAME} !-d
  55. RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
Add Comment
Please, Sign In to add comment