Forum Moderators: coopster & phranque

Message Too Old, No Replies

URL redirection

This should be simple?

         

msr986

6:53 am on Nov 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some of my sites will redirect a request of
_http://some_url.com to
_http://www.some_url.com; others don't.

How can I force my server to always redirect to "www"?

I need this for consistent cookie handling.

Xoc

4:51 pm on Nov 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What web server? There is a good discussion in this thread: [webmasterworld.com ] for both Apache and IIS.

What's the meaning of the 986 in your username?

msr986

8:57 pm on Nov 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Xoc,

Thanks for the other thread, but the .htaccess "redirect" does not fix the problem. My server gets hung in a loop when I try this. All access is redirected back to itself.

This site is hosted by Mindspring; Apache on DecAlpha.

Is there a way for the .htaccess to determine which URL was called? Is there a way to rewrite the URL?

ANY IDEAS??????

> What's the meaning of the 986 in your username?

The "986" corresponds to the post office box in my mailing address.

"MSR" are my initials.

Marty

msr986

10:59 pm on Nov 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I also tried this:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.MY_DOMAIN\.com [NC]
RewriteRule ^/(.*) [MY_DOMAIN.com...] [P]

This does not seem to have an effect. Is there something wrong with the statement?

msr986

11:26 pm on Nov 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hooray!

Got it, this is what worked:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.MY_DOMAIN\.com [NC]
RewriteRule ^(.*) [MY_DOMAIN.com...] [L]

Thanks!