Chris@1115
|
1 # General Apache options
|
Chris@1115
|
2 <IfModule mod_fastcgi.c>
|
Chris@1115
|
3 AddHandler fastcgi-script .fcgi
|
Chris@1115
|
4 </IfModule>
|
Chris@1115
|
5 <IfModule mod_fcgid.c>
|
Chris@1115
|
6 AddHandler fcgid-script .fcgi
|
Chris@1115
|
7 </IfModule>
|
Chris@1115
|
8 Options +FollowSymLinks +ExecCGI
|
Chris@1115
|
9
|
Chris@1115
|
10 # If you don't want Rails to look in certain directories,
|
Chris@1115
|
11 # use the following rewrite rules so that Apache won't rewrite certain requests
|
Chris@1115
|
12 #
|
Chris@1115
|
13 # Example:
|
Chris@1115
|
14 # RewriteCond %{REQUEST_URI} ^/notrails.*
|
Chris@1115
|
15 # RewriteRule .* - [L]
|
Chris@1115
|
16
|
Chris@1115
|
17 # Redirect all requests not available on the filesystem to Rails
|
Chris@1115
|
18 # By default the cgi dispatcher is used which is very slow
|
Chris@1115
|
19 #
|
Chris@1115
|
20 # For better performance replace the dispatcher with the fastcgi one
|
Chris@1115
|
21 #
|
Chris@1115
|
22 # Example:
|
Chris@1115
|
23 # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
Chris@1115
|
24 RewriteEngine On
|
Chris@1115
|
25
|
Chris@1115
|
26 # If your Rails application is accessed via an Alias directive,
|
Chris@1115
|
27 # then you MUST also set the RewriteBase in this htaccess file.
|
Chris@1115
|
28 #
|
Chris@1115
|
29 # Example:
|
Chris@1115
|
30 # Alias /myrailsapp /path/to/myrailsapp/public
|
Chris@1115
|
31 # RewriteBase /myrailsapp
|
Chris@1115
|
32
|
Chris@1115
|
33 RewriteRule ^$ index.html [QSA]
|
Chris@1115
|
34 RewriteRule ^([^.]+)$ $1.html [QSA]
|
Chris@1115
|
35 RewriteCond %{REQUEST_FILENAME} !-f
|
Chris@1115
|
36 <IfModule mod_fastcgi.c>
|
Chris@1115
|
37 RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
Chris@1115
|
38 </IfModule>
|
Chris@1115
|
39 <IfModule mod_fcgid.c>
|
Chris@1115
|
40 RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
Chris@1115
|
41 </IfModule>
|
Chris@1115
|
42
|
Chris@1115
|
43 # In case Rails experiences terminal errors
|
Chris@1115
|
44 # Instead of displaying this message you can supply a file here which will be rendered instead
|
Chris@1115
|
45 #
|
Chris@1115
|
46 # Example:
|
Chris@1115
|
47 # ErrorDocument 500 /500.html
|
Chris@1115
|
48
|
Chris@1115
|
49 ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
|