# R:link and hosting multiple sites off a single radiant insta

**URL:** <https://www.ruby-forum.com/t/r-link-and-hosting-multiple-sites-off-a-single-radiant-insta/82067>\
**Category:** Radiant CMS\
**Created:** [January 17, 2007, 6:49am UTC](https://www.ruby-forum.com/t/r-link-and-hosting-multiple-sites-off-a-single-radiant-insta/82067 "2007-01-17T06:49:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickharlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@patrickharlan](https://www.ruby-forum.com/u/patrickharlan)\
**Post date:** [January 17, 2007, 6:49am UTC](https://www.ruby-forum.com/t/r-link-and-hosting-multiple-sites-off-a-single-radiant-insta/82067/1 "2007-01-17T06:49:05Z")

</div>

After reading the suggestion at  
[http://dev.radiantcms.org/radiant/wiki/HowToHostMultipleWebsites](http://dev.radiantcms.org/radiant/wiki/HowToHostMultipleWebsites)

I tried setting up just such a system. It largely works; however,  
unsurprisingly the r:link tag is thoroughly confused. As radiant does  
not know that apache is “rehoming” all of its tags, I get goofed up  
links.

If I am missing something and there is an easy way around this  
problem, please let me know. If not one thing that is working for me  
is this simple patch against r:link, allowing for a “base” option that  
is removed from the front of the url.

Thanks for Radiant  
pth

# Index: /Users/phurley/mental/radiant/app/models/standard\_tags.rb

— /Users/phurley/mental/radiant/app/models/standard\_tags.rb (revision  
233)  
+++ /Users/phurley/mental/radiant/app/models/standard\_tags.rb (working  
copy)  
@@ -340,10 +340,13 @@  
tag ‘link’ do |tag|  
options = tag.attr.dup  
anchor = options[‘anchor’] ? “##{options.delete(‘anchor’)}” : ‘’

- base = options[‘base’] ? options.delete(‘base’) : nil  
attributes = options.inject(‘’) { |s, (k, v)| s \<\<  
%{#{k.downcase}=“#{v}” } }.strip  
attributes = " #{attributes}" unless attributes.empty?  
text = tag.double? ? tag.expand : tag.render(‘title’)

- %{\<a href=“#{tag.render(‘url’)}#{anchor}”#{attributes}\>#{text}}

- url = tag.render(‘url’)
- url = url.sub(/^#{base}/,‘’) if base
- %{\<a href=“#{url}#{anchor}”#{attributes}"\>#{text}}  
end

desc %{ \<r:breadcrumbs [separator=“separator\_string”] /\>
