Tom,

Normally I would be configure this in my apache config, not use an .htaccess
rewrite rule.

I would use a wildcard mapping for your ServerAlias config... instead of
setting NAME.website.com to point at the /rails/radiant/NAME dir, I would
set ServerAlias *.website.com

See these for more info:

http://allyourtech.com/content/articles/25_11_2005_setting_up_wildcard_subdomains_on_apache.php
http://httpd.apache.org/docs/2.0/vhosts/examples.html
http://httpd.apache.org/docs/2.0/mod/core.html#serveralias
http://httpd.apache.org/docs/2.0/vhosts/name-based.html

Hope that helps,
Ben

On Thu, Feb 11, 2010 at 14:53, <[email protected]> wrote:
>
> From: Tom Stoll <[email protected]>
> To: [email protected]
> Date: Thu, 11 Feb 2010 10:39:39 -0800
> Subject: [Radiant] htaccess questions
> Hi,
>
> I have been trying to set up htaccess in a certain way for some time now.
> Is
> the following possible?
>
> Given:
> Radiant installation: /rails/radiant/NAME
> domain: website.com
> Subdomain set up to point to NAME: NAME.website.com symlinked to
> /rails/radiant/NAME (index.html removed from the subdomain's folder)
>
> Type in NAME.website.com and you go to the Rails/Radiant app, and all the
> internal links work properly.
>
> type in website.com/NAME, and you get the app, but it has lost its styling
> and Rails/Radiant cannot resolve the links.
>
> type in www.website.com/NAME and you get the public_html directory
> listing.
>
> What I'd like to be able to do is have www.website.com redirect to the
> application at the subdomain NAME.
>
> Here are my htaccess rewrite lines. Like I said, they handle the
> subdomain-to-app mapping. I'd like to link www to the app or, in other
> words, make the subdomain the 'default' and behave like it is sitting in
> the
> public_html folder. My understanding is that this is possible and quite
> common, but I can't find documentation that explains this common
> functionality.
>
> .htaccess==========
> RewriteRule ^$ index.html [QSA]
> RewriteRule ^([^.]+)$ $1.html [QSA]
> RewriteCond %{REQUEST_FILENAME} !-f
> #RewriteRule ^images/.*.(jpg|gif|png|bmp)$ /blank.$1 [NC,L]
> #RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
>
> setEnv RAILS_ENV production
> RewriteCond %{HTTP_HOST} ^www.website.com$ [OR]
> RewriteCond %{HTTP_HOST} ^www.NAME.website.com$ [OR]
> RewriteCond %{HTTP_HOST} ^name.website.com$
> RewriteRule ^/?$ "http\:\/\/website\.com\/NAME\/" [R=301,L]
>
> Feel free to point out my flawed logic or obvious mistakes. It seems to me
> that this should be a simple thing to do.
>
> Thanks,
> =tom
>
>
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
List Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Radiant: http://radiantcms.org
Extensions: http://ext.radiantcms.org

Reply via email to