Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <Directory /var/www/sites/sitename/>
  2. # Rewrite any calls to *.html, *.json, *.xml, *.atom, *.rss, *.rdf or *.txt if a folder matching * exists
  3. RewriteCond %{REQUEST_FILENAME} !-f
  4. RewriteCond %{REQUEST_URI} !public/
  5. RewriteCond %{DOCUMENT_ROOT}/public/$1.$2 !-f
  6. RewriteRule (.+).(html|json|xml|atom|rss)$ $1/ [L]
  7.  
  8. # Add a trailing slash to directories
  9. RewriteCond %{REQUEST_FILENAME} !-f
  10. RewriteCond %{REQUEST_FILENAME} !-d
  11. RewriteCond %{REQUEST_URI} !(.|?)
  12. RewriteCond %{REQUEST_URI} !(.*)/$
  13. RewriteRule ([^/]+)$ $1/ [L]
  14.  
  15. # Rewrite any calls to /render to the image parser
  16. RewriteCond %{REQUEST_URI} render/
  17. RewriteRule ^render/. app/parsers/slir/ [L]
  18.  
  19. # Rewrite routes to index.php if they are non-existent files/dirs
  20. RewriteCond %{REQUEST_FILENAME} !-f
  21. RewriteCond %{REQUEST_FILENAME} !-d
  22. RewriteRule ^(.*)/$ index.php?/$1/ [L,QSA]
  23.  
  24. # Rewrite any file calls to the public directory
  25. RewriteCond %{REQUEST_FILENAME} !-f
  26. RewriteCond %{REQUEST_FILENAME} !-d
  27. RewriteCond %{REQUEST_URI} !public/
  28. RewriteRule ^(.+)$ public/$1 [L]
  29.  
  30. # Allow basic authentication
  31. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  32. </Directory>
  33.  
  34. <DirectoryMatch /var/www/sites/[^/]+/>
  35. {{ RULES_BE_HERE }}
  36. </DirectoryMatch>
  37. <Directory /var/www/sites/.*/>
  38. RewriteBase /
  39. {{ RULES_BE_HERE }}
  40. </DirectoryMatch>
  41.  
  42. <Directory /var/www/sites/site1/>
  43. Include /etc/apache2/myrules.conf
  44. </Directory>
  45. <Directory /var/www/sites/site2/>
  46. Include /etc/apache2/myrules.conf
  47. </Directory>
  48. <Directory /var/www/sites/site3/>
  49. Include /etc/apache2/myrules.conf
  50. </Directory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement