Welcome Guest | Login

301 redirects not working (mongrel?)

I want to redirect mysite.com to www.mysite.com.
I've been following the instrs here: http://ekstreme.com/phplabs/301-redirection-code.php
What they have is the following:
Add this to your .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.com [nc]
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]

I tried that and it causes the images and javascript on my site to not work,
not get loaded.

I notice that the instrs for 301 redirect is using fastcgi.
Suggestions?
thanks!

2007-07-31 12:34 AM

Hi there - yeah these have to be added to your vhost because you're on Mongrel, which doesn't look at your .htaccess (static files served by apache do, which explains the images/javascript problems).   I see you have a support ticket in for this so you should be hooked up shortly.

2007-07-31 01:07 AM

Hello,

You were running on mongrel server which overrides the .htaccess file related with the apache web server. I have put the necesary rules inside the vhost of your main domain and it is redirecting properly from domain.com to www.domain.com.

2007-07-31 01:54 AM

Regards,
Rahul

Hello Guest! In order to post you must be an active client with us, please log in or sign up.