# Files on the Filesystem not managed by Radiant

**URL:** <https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402>\
**Category:** Radiant CMS\
**Created:** [September 12, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402 "2006-09-12T13:22:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [September 12, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402/1 "2006-09-12T13:22:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [September 12, 2006, 2:36pm UTC](https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402/2 "2006-09-12T14:36:53Z")

</div>

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](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [September 13, 2006, 4:08am UTC](https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402/3 "2006-09-13T04:08:27Z")

</div>

On Sep 13, 2006, at 9:22 AM, Dave C. wrote:

> On 12/09/06, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [September 13, 2006, 9:54am UTC](https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402/4 "2006-09-13T09:54:36Z")

</div>

On 13/09/06, Bodhi [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://www.primehosting.co.uk) who are excellent btw 🙂  
and have emailed their support team.

Thanks!

–  
Regards,  
Dave

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [September 13, 2006, 2:24am UTC](https://www.ruby-forum.com/t/files-on-the-filesystem-not-managed-by-radiant/68402/5 "2006-09-13T02:24:18Z")

</div>

On 12/09/06, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
