pezdude
September 12, 2006, 1:22pm
1
Hi,
I have radiant installed via gem and then executed on the directory
/home/ukktug/radiant/
I then have a symlink /home/ukktug/public_html -> radiant/public/
This is then servied via Apache with FCGI to Rails (I think
I have a lot of older legacy files which I would like to place in the
public directory, and slowly migrate them into the Radiant system.
So ideally I want Apache to serve files that exist, and any that 404
to pass to Radiant to serve or acutally 404.
Is this possible?
–
Regards,
Dave
pezdude
September 12, 2006, 2:36pm
2
Dave C. wrote:
So ideally I want Apache to serve files that exist, and any that 404
to pass to Radiant to serve or acutally 404.
Is this possible?
Yes. It should be working this way by default.
–
John L.
http://wiseheartdesign.com
pezdude
September 13, 2006, 4:08am
3
On Sep 13, 2006, at 9:22 AM, Dave C. wrote:
On 12/09/06, John W. Long [email protected] wrote:
Dave C. wrote:
So ideally I want Apache to serve files that exist, and any that 404
to pass to Radiant to serve or acutally 404.
Is this possible?
Yes. It should be working this way by default.
RewriteCond %{REQUEST_URI} ^/images.*
RewriteRule .* - [L]
I dont think these are really necessary if the Rewrites below are
configured properly
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Membership/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Resources/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Spreadsheets/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/TUG/.*
RewriteRule .* - [L]
If the stuff in these directories is all static files (even php
files) then you can probably get away without it
For Phil Taylors site archive
DirectoryIndex Index.html
Redirect all requests not available on the filesystem to Rails
By default the cgi dispatcher is used which is very slow
For better performance replace the dispatcher with the fastcgi one
Example:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
^^^^^^^^^^^^^
This is probably the line that is giving you grief. it says redirect
all requests (apart from those in the above directories) to the rails
dispatcher. Delete it or comment it out, as you can just use the one
below
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
Good luck! mod_rewrite is sometimes just black-magic
Bodhi
pezdude
September 13, 2006, 9:54am
4
On 13/09/06, Bodhi [email protected] wrote:
Good luck! mod_rewrite is sometimes just black-magic
Yup
I’ve tried commenting out that line and removing my specific rewrites,
but it doesnt work. I suspect a system wide apache configuration with
my hosting provider (www.primehosting.co.uk who are excellent btw
and have emailed their support team.
Thanks!
–
Regards,
Dave
pezdude
September 13, 2006, 2:24am
5
On 12/09/06, John W. Long [email protected] wrote:
Dave C. wrote:
So ideally I want Apache to serve files that exist, and any that 404
to pass to Radiant to serve or acutally 404.
Is this possible?
Yes. It should be working this way by default.
Hmm :-/
After playing with my /home/ukktug/radiant/public/.htaccess I got the
behaviour I want working, although it means updating this file each
time a directory/file is added outside of Radiant’s control.
– 8< –
PrimeHosting
AddDefaultCharset UTF-8
General Apache options
AddHandler fastcgi-script .fcgi
#AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
Rewrites
RewriteEngine On
If you don’t want Rails to look in certain directories,
use the following rewrite rules so that Apache won’t
rewrite certain requests
Example:
RewriteCond %{REQUEST_URI} ^/notrails.*
RewriteRule .* - [L]
Radiant Rewrites
RewriteCond %{REQUEST_URI} ^/robots.txt.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/favicon.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/stylesheets.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/javascripts.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/images.*
RewriteRule .* - [L]
UKTUG Rewrites
RewriteCond %{REQUEST_URI} ^/Activities/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Audio/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Baskerville/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Committee/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Constitution/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Membership/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Resources/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/Spreadsheets/.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/TUG/.*
RewriteRule .* - [L]
For Phil Taylors site archive
DirectoryIndex Index.html
Redirect all requests not available on the filesystem to Rails
By default the cgi dispatcher is used which is very slow
For better performance replace the dispatcher with the fastcgi one
Example:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
If your Rails application is accessed via an Alias directive,
then you MUST also set the RewriteBase in this htaccess file.
Example:
Alias /myrailsapp /path/to/myrailsapp/public
RewriteBase /myrailsapp
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
In case Rails experiences terminal errors
Instead of displaying this message you
can supply a file here which will be rendered instead
Example:
ErrorDocument 500 /500.html
ErrorDocument 500 “
Application error Rails no start”
– 8< –
–
Regards,
Dave