# Using Radiant with Rails apps, but "the other way round"

**URL:** <https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447>\
**Category:** Radiant CMS\
**Created:** [October 27, 2007, 2:01am UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447 "2007-10-27T02:01:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 27, 2007, 2:01am UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/1 "2007-10-27T02:01:55Z")

</div>

Hey, guys.

I am considering using Radiant to run my site, since I just love its  
simplicity and extensibility. This is a great product, thank you for  
writing it!

So here’s my question: What if I want to use Radiant to run the root  
of my site, but I want to have different apps in it, running from  
subdirectories / subdomains?

I’ll try to explain a bit better:

Say I install Radiant in my site, at [http://www.example.com/](http://www.example.com/). I manage  
my blog and static pages from Radiant, and everything is beautiful.  
Then I want to write a small Rails app of my own and host it in  
[http://www.example.com/myapp/](http://www.example.com/myapp/).

I figured I’d just have a symlink inside Radiant’s public/ dir to  
myapp/public, but I am not sure all the rewriting .htaccess magic will  
“just work”, since, as I understand it, Apache might think an address  
like [http://www.example.com/myapp/mycontroller/myaction/](http://www.example.com/myapp/mycontroller/myaction/) is actually  
something to be redirected to Radiant, and not to MyApp.

Does anyone here have any experience with such settings?

Thanks a lot, and keep up the great work!

Marcelo.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 27, 2007, 4:21pm UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/2 "2007-10-27T16:21:40Z")

</div>

Marcelo,

If you don’t require any integration between Radiant and your other  
applications, the proper way to do it would be in your webserver  
configuration, with rewrite rules, perhaps. Then your apps don’t need  
to necessarily know about each other. This is the way we did it at  
KCKCC, with Litespeed web server. For example:

[http://kckcc.edu/](http://kckcc.edu/) (Radiant)  
[http://kckcc.edu/college-support-services/buildings-and-grounds/events/](http://kckcc.edu/college-support-services/buildings-and-grounds/events/)  
(A room reservation calendar, separate Rails app)  
[http://kckcc.edu/library/morgue](http://kckcc.edu/library/morgue) (A journal index Rails app)  
[http://kckcc.edu/academics/class-schedules](http://kckcc.edu/academics/class-schedules) (The POST location of the  
form is a Perl script on another box, through proxy)

As you can see, there are lots of ways to make your apps look integrated  
into your main site.

Sean

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 27, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/3 "2007-10-27T22:51:25Z")

</div>

Hi, Sean.

I appreciate your help, and that’s exactly what I had in mind.

So, I think I know how to get this to work, but could you just confirm  
it for me? What I’m thinking is that I’d have to edit the .htaccess  
file on the root directory (which is Radiant’s public directory) and  
make Apache bypass the rewriting for this directory. Something like:

# myRadiantApp/public/.htaccess:

RewriteCond %{REQUEST\_URI} ^/myOtherApp\*  
RewriteRule .\* - [L]

And then the .htaccess file inside /myOtherApp would catch those  
requests and use its own rewriting rules to make everything work.

Is this how that’s supposed to work? I imagine I might have to tweak  
it here and there a little bit, but do you think this is generally how  
it should work?

Thank you again (both for Radiant and for the help),  
Marcelo.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 27, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/4 "2007-10-27T23:55:08Z")

</div>

Hmmmmmm, ok, got it.

The problem is I use a shared RailsPlayground account… So that’s  
Apache + FCGI, and no httpd.conf access. I guess that would be too  
much of a pain, then?

Thanks again,  
Marcelo.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 27, 2007, 11:52pm UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/5 "2007-10-27T23:52:13Z")

</div>

Marcelo,

Unless you’re using FCGI to host your Radiant and other apps, I would  
advise against using the .htaccess. It’s better to do the configuration  
in a regular config file, whether the main Apache httpd.conf or an  
included file. I would also either alias given URL paths to your other  
apps’ public directories or use rewrite rules to proxy to the proper  
Mongrel-cluster. Placing them as soft links inside your Radiant app is  
probably not advisable – it could get too unpredictable.

Sean

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 28, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/6 "2007-10-28T17:31:09Z")

</div>

If you have access to Webmin or something of the sort, you could still  
setup aliases and directories.

Sean

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [October 29, 2007, 2:10am UTC](https://www.ruby-forum.com/t/using-radiant-with-rails-apps-but-the-other-way-round/118447/7 "2007-10-29T02:10:37Z")

</div>

Yeah, I have cPanel, which might do the trick.

But then that is not really a Radiant question, so I’ll try to figure  
that out on my own. Thanks a lot for the pointers, that helped me a  
lot.

Cheers,  
Marcelo.
