# Radiant and Relative Path Plugin?

**URL:** <https://www.ruby-forum.com/t/radiant-and-relative-path-plugin/83248>\
**Category:** Radiant CMS\
**Created:** [January 24, 2007, 5:04pm UTC](https://www.ruby-forum.com/t/radiant-and-relative-path-plugin/83248 "2007-01-24T17:04:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Dorner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@Chris\_Dorner](https://www.ruby-forum.com/u/Chris_Dorner)\
**Post date:** [January 24, 2007, 5:04pm UTC](https://www.ruby-forum.com/t/radiant-and-relative-path-plugin/83248/1 "2007-01-24T17:04:33Z")

</div>

Hi there,

I wanted to ask if it’s possible to run Radiant with the Relative Path  
Plugin?

Regards,  
Christof

---

<div class="post-metadata">

**Author:** ![Chris\_Dorner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@Chris\_Dorner](https://www.ruby-forum.com/u/Chris_Dorner)\
**Post date:** [January 24, 2007, 5:25pm UTC](https://www.ruby-forum.com/t/radiant-and-relative-path-plugin/83248/2 "2007-01-24T17:25:42Z")

</div>

Chris Dorner wrote:

> I wanted to ask if it’s possible to run Radiant with the Relative Path  
> Plugin?

I’m not familiar with that plugin. What is it that you are trying to do?

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Chris\_Dorner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@Chris\_Dorner](https://www.ruby-forum.com/u/Chris_Dorner)\
**Post date:** [January 25, 2007, 12:40am UTC](https://www.ruby-forum.com/t/radiant-and-relative-path-plugin/83248/3 "2007-01-25T00:40:06Z")

</div>

The admin pages should work with the relative path plugin, but the  
actual site itself might be an issue because it doesn’t actually use  
url\_for, which is what the relative path plugin hooks into. Oh, and by  
the way, you’d be using a ReverseProxy directive in apache, not an  
Alias.

The problem that you’ll have is that the Page#url method is used  
everywhere for both the rendering of links to the user and also the  
matching of urls. You want to match against /articles/monkeys-are-great,  
but render /radiant/articles-are-great.

The simplest approach would probably be to set up two ProxyPass  
statements in apache:

ProxyPass /radiant/admin/ [http://localhost:3000/admin/](http://localhost:3000/admin/)  
ProxyPassReverse /radiant/admin/ [http://localhost:3000/admin/](http://localhost:3000/admin/)

ProxyPass /radiant/ [http://localhost:3000/radiant/](http://localhost:3000/radiant/)  
ProxyPassReverse /radiant/ [http://localhost:3000/radiant/](http://localhost:3000/radiant/)

And then create a parent /radiant/ page in radiant and make everything a  
child of that.

Otherwise, you might be able to make it work with:

class Page  
def url  
if parent?  
parent.child\_url(self)  
else  
clean\_url(“/radiant/#{slug}”)  
end  
end  
end

class SiteController  
def show\_page  
response.headers.delete(‘Cache-Control’)  
url = “/radiant/#{params[:url].to\_s}”  
if live? and (@cache.response\_cached?(url))  
@cache.update\_response(url, response)  
@performed\_render = true  
else  
show\_uncached\_page(url)  
end  
end  
end

* * *

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Chris Dorner  
Sent: Thursday, 25 January 2007 8:39 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Radiant] Radiant and Relative Path Plugin?

I made an Alias on Apache ([server.com/radiant/](http://server.com/radiant/)) which redirects  
the request to the mongrel server, but Rails has just absolute links  
(i.e. [server.com/admin/pages](http://server.com/admin/pages) ) but it should be rendered as  
[server.com/radiant/admin/pages](http://server.com/radiant/admin/pages).

---

<div class="post-metadata">

**Author:** ![Chris\_Dorner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@Chris\_Dorner](https://www.ruby-forum.com/u/Chris_Dorner)\
**Post date:** [January 24, 2007, 10:40pm UTC](https://www.ruby-forum.com/t/radiant-and-relative-path-plugin/83248/4 "2007-01-24T22:40:50Z")

</div>

I made an Alias on Apache ([server.com/radiant/](http://server.com/radiant/)) which redirects the  
request  
to the mongrel server, but Rails has just absolute links (i.e.  
[server.com/admin/pages](http://server.com/admin/pages)) but it should be rendered as  
[server.com/radiant/admin/pages](http://server.com/radiant/admin/pages).
