Guest User

Untitled

a guest
Feb 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. # General Apache options
  2. AddHandler fastcgi-script .fcgi
  3. AddHandler cgi-script .cgi
  4. Options +FollowSymLinks +ExecCGI
  5.  
  6. # If you don't want Rails to look in certain directories,
  7. # use the following rewrite rules so that Apache won't rewrite certain requests
  8. #
  9. # Example:
  10. # RewriteCond %{REQUEST_URI} ^/notrails.*
  11. # RewriteRule .* - [L]
  12.  
  13. # Redirect all requests not available on the filesystem to Rails
  14. # By default the cgi dispatcher is used which is very slow
  15. #
  16. # For better performance replace the dispatcher with the fastcgi one
  17. #
  18. # Example:
  19. # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
  20. RewriteEngine On
  21.  
  22. # Apache redirects some of Mephistos URL’s with a trailing slash
  23. # because the cached directory structure on the server makes Apache
  24. # think you are requesting a directory. This works with GET requests,
  25. # but most clients, including IE and Firefox will *wrongly* handle a
  26. # POST redirect with a GET to the new url, which generates the exception.
  27. DirectorySlash Off
  28.  
  29. # If your Rails application is accessed via an Alias directive,
  30. # then you MUST also set the RewriteBase in this htaccess file.
  31. #
  32. # Example:
  33. # Alias /myrailsapp /path/to/myrailsapp/public
  34. # RewriteBase /myrailsapp
  35.  
  36. RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
  37.  
  38. RewriteRule ^/assets/(\d+)/(.+)$ /assets/%{HTTP_HOST}/$1/$2 [L]
  39.  
  40. # Rewrite index to check for static
  41. # RewriteRule ^/$ /index.html [QSA]
  42. RewriteRule ^/$ /index.html [QSA]
  43.  
  44. # Rewrite to check for Rails cached page
  45. # RewriteRule ^([^.]+)$ $1.html [QSA]
  46. RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}/$1 [QSA]
  47. RewriteRule ^(.*)/([^.]*)$ $1/$2.html [QSA]
  48.  
  49. # Redirect all non-static requests to cluster
  50. RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
  51. RewriteRule ^/(.*)$ balancer://publishwithimpunity_cluster%{REQUEST_URI} [P,QSA,L]
  52.  
  53. # In case Rails experiences terminal errors
  54. # Instead of displaying this message you can supply a file here which will be rendered instead
  55. #
  56. # Example:
  57. # ErrorDocument 500 /500.html
  58.  
  59. ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
Add Comment
Please, Sign In to add comment