# How can i deploy radiant application to sub-directory?

**URL:** <https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672>\
**Category:** Radiant CMS\
**Created:** [November 26, 2010, 7:53am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672 "2010-11-26T07:53:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 26, 2010, 7:53am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/1 "2010-11-26T07:53:06Z")

</div>

Hello~ I’ m trying to deploy my radiant web application with use  
sub-directory

just like below

localhost/  
localhost/dictionary

so i’ve tried to search how to deploy in sub directory in everywhere  
then i got some clues about change config/enviroment.rb  
to add below line  
config.action\_controller.relative\_url\_root = “/dictionary”

and it’s simply works nevertheless it’s not change about public path,  
it’s not that story  
I mean under public path’s image files or css files are stil in that  
path -\> public/image.jpg

also it has got one more problem that can’t be shown files under assets  
path  
so when i access to admim page, every css and image files were not be  
shown  
but still my site was normal, only have problem in admin page

my env is  
ruby - 1.8.7  
radiantcms - 0.9.1

anyone can help me please?  
Ill thank you in little clue!

with Best regards!

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 27, 2010, 12:49am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/2 "2010-11-27T00:49:13Z")

</div>

What you’ve discovered is unfortunately one of Radiant’s shortcomings.

Radiant expects to be deployed at the root of your particular domain.

If you want to deploy it into a subdirectory, there is no easy way.  
You gonna have to update a lot of files to point to the new  
subdirectory (things like css, js, and many others).  
It’s not hard, just time consuming and error prone.

My recommendation:  
If you can, deploy radiant to a subdomain instead of a subdirectory.

For example to [dictionary.yourdomain.com](http://dictionary.yourdomain.com) instead of [yourdomain.com/](http://yourdomain.com/)  
dictionary

–  
swartz

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 27, 2010, 2:29am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/3 "2010-11-27T02:29:05Z")

</div>

Hi Swartz,

On 27/11/2010 7:48 AM, swartz wrote:

> If you can, deploy radiant to a subdomain instead of a subdirectory.
> 
> For example to [dictionary.yourdomain.com](http://dictionary.yourdomain.com) instead of [yourdomain.com/](http://yourdomain.com/)  
> dictionary  
> The Bitnami Radiant stack is configured to work off domain/radiant - you  
> may be able to get it working if you take a look at that.

This is on Radiant 0.8.1 - [http://bitnami.org/stack/radiant](http://bitnami.org/stack/radiant)  
You can get an Ubuntu or OpenSuse image there (OpenSuse was easier for  
me with Virtualbox).

Cheers,  
Mohit.  
27/11/2010 | 9:26 AM.

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 27, 2010, 9:44am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/4 "2010-11-27T09:44:36Z")

</div>

Why wouldn’t a web-server-level (e.g. Apache) rewrite work?

Thanks,  
Fima

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 29, 2010, 2:28am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/5 "2010-11-29T02:28:07Z")

</div>

On Sun, Nov 28, 2010 at 8:14 PM, Ahn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> anyone teach me what is this mean? actually I tried to search about  
> this, and I’ve got nothing…
> 
> thank you again!

I made changes so that the paths were not hard-coded to begin with the  
root (in other words, it uses the relative\_url\_root). I had asked for  
some feedback on the mailing list for anyone who was interested in  
deploying to a sub-directory but received none. I personally have no  
need for this feature.  
If you can contribute bug reports or fixes, it would be appreciated; I  
must have missed something.

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 29, 2010, 2:14am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/6 "2010-11-29T02:14:59Z")

</div>

Thank you so much for replying.

I should use sub domain instead sub directory.

but I have still wonder about sub directory cuz I saw it’s possible to  
use sub directory in radiant cms website

[http://radiantcms.org/blog/archives/2010/06/25/radiant-0-9-0---refraction-release/](http://radiantcms.org/blog/archives/2010/06/25/radiant-0-9-0---refraction-release/)  
(You can now run Radiant from a sub-directory. by Jim G.)

anyone teach me what is this mean? actually I tried to search about  
this, and I’ve got nothing…

thank you again!

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 29, 2010, 4:00am UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/7 "2010-11-29T04:00:44Z")

</div>

Thanks to reply Jim. my pleasure and sorry for disturbing.

Actually, It’s working that you made. but the problem is setting I did.

when I write config.action\_controller.relative\_url\_root = “/dictionary”  
in enviroment.rb

it works just fine, but when I access to admin page, I could see no css  
and image files

it maybe also change assets path to /dictionary, but there is no  
/dictionary path physically.

so I tried link by follow command -\> ln -s /webapps/mycook/public  
/webapps/mycook/public/dictionary

from that, it works fine! my question is, is this best way I can? and is  
this correct way in radiantcms?

that’s all~ anyway I think I solve this problem from kindness people

thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![Ahn\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@Ahn\_B](https://www.ruby-forum.com/u/Ahn_B)\
**Post date:** [November 29, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/how-can-i-deploy-radiant-application-to-sub-directory/199672/8 "2010-11-29T15:37:46Z")

</div>

What about a simple .htaccess rewrite rule?

Something like:  
RewriteCond %{REQUEST\_URI} !^/dictionary [NC]  
RewriteRule ^(.\*)$ /dictionary/$1 [QSA,L,NC]

Note: The above is untested.

* * *

From: Ahn B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Sent: Sun, November 28, 2010 9:59:40 PM  
Subject: Re: [Radiant] Re: How can i deploy radiant application to  
sub-directory?

Thanks to reply Jim. my pleasure and sorry for disturbing.

Actually, It’s working that you made. but the problem is setting I did.

when I write config.action\_controller.relative\_url\_root = “/dictionary”  
in  
enviroment.rb

it works just fine, but when I access to admin page, I could see no css  
and  
image files

it maybe also change assets path to /dictionary, but there is no  
/dictionary  
path physically.

so I tried link by follow command → ln -s /webapps/mycook/public  
/webapps/mycook/public/dictionary

from that, it works fine! my question is, is this best way I can? and is  
this  
correct way in radiantcms?

that’s all~ anyway I think I solve this problem from kindness people

thanks a lot 🙂
