Re: [Radiant] htaccess questions (Tom Stoll)

2010-02-12 Thread Ben Evans
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, radiant-requ...@radiantcms.org wrote:

 From: Tom Stoll tom.stoll.h...@gmail.com
 To: radiant@radiantcms.org
 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:   Radiant@radiantcms.org
 Search: http://radiantcms.org/mailing-list/search/
 Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

___
Radiant mailing list
Post: Radiant@radiantcms.org
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


[Radiant] htaccess questions

2010-02-11 Thread Tom Stoll
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: Radiant@radiantcms.org
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


[Radiant] htaccess

2010-02-10 Thread Tom Stoll
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: Radiant@radiantcms.org
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


[Radiant] .htaccess mod_rewrite woes

2008-07-15 Thread Oli Studholme

Hi All,

I just can’t seem to get redirects going in  
Radiant’s .htaccess. Can someone enlighten me?


In the default .htaccess file after RewriteEngine On (shich should be  
after the Options at the top btw) I tried these vavriants


RewriteRule from.html to.html

RewriteRule from.html http://domain/to.html [R=301,L]

RewriteCond %{REQUEST_URI} ^/from\.html
RewriteRule .* http://domain.com/to.html [R=301,L]

which all work on another domain on this server. Nothing happens. I  
also tried adding the example ‘tell Rails to ignore this’  
rules, but I’m probably doing it wrong.


RewriteRule from.html to.html
RewriteCond %{REQUEST_URI} ^/to\.html
RewriteRule .* - [L]

Any ideas? I actually want to redirect one file and map it to a  
subdomain (eg http://domain.com/test to http://test.domain.com/), but  
I can’t even get simple file redirection going. Finally  
I’d like to know if it’s possible to use .htaccess to  
generate canonical URLs. Specifically I want http://domain.com/ to  
redirect to http://www.domain.com/, and all trailing slashes to be  
stripped eg http://www.domain.com/news/ to http://www.domain.com/news


Thanks for your time

peace - oli

PS This is using Radiant 0.6.6, the last version that supports the  
gettext interface localization plugin I’m using. Btw what needs  
to be done to resurrect jargon’s gibberish i18n support?  
I can’t even get jargon to install atm

___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant