Redirects with mongrel (dropping the www. from a url)

Hi All,

I have a rails app running on an apache virtual host with mongrel that
i want to set up a redirect from to
the www.)

I have tried doing this in apache using a rewrite rule (below) which
worked before when the app was written in php.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^ [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*)$1 [L,R]

Now the app has been completely re written in rails using mongrel &
apache (i don’t really understand much about web servers but mongrel
set up was nice and simple). However my redirect does not work any
longer. I cant seem to find any information on the web (which would
suggest i’m looking in the wrong places).

can anyone suggest a solution to my problem or point me in the right
please be gentle, as i mentioned before servers are not my strong

Thank you.

Not enough info to debug here, and whether it’s PHP vs. Mongrel shld be

Short of that, here’s something that works. If I state that the backend
is Mongrel/Nitro will the moderator consider this on-topic? :slight_smile:

<VirtualHost *:80>
RewriteEngine On

RewriteCond %{SERVER_NAME}
RewriteRule ^.*$$1 [L,R]