Forum Moderators: phranque

Message Too Old, No Replies

rewrite to www on a site with subdomains?

         

lbobke

8:07 am on Oct 17, 2004 (gmt 0)

10+ Year Member



I want to make sure that all requests to mydomain.net are being forwarded to www.mydomain.net.
This would be easy if I hadn't a number of subdomains on mydomain.net.
As it is, when redirecting with mod_rewrite, the subdomains return a page not found eror.
Is there a way to redirect only requests where there is nothing before "mydomain.net" (or nothing between "http://" and "mydomain.net[/i]").

Thanks!

Laurenz

jdMorgan

12:12 am on Oct 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See message #16 of this thread: [webmasterworld.com...]

Jim

lbobke

5:14 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



Sorry Jim,

but this message only explains how to rewrite from "www" to no "www"?
In my case, I have hundreds of links pointing to the "www" version, so I would like to go the other way and rewrite from "nothing" to "www".
Any idea how I could do this without creating problems for my subdomains?

Thanks!

Laurenz

jdMorgan

6:43 pm on Oct 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please study it and try to understand how that code works. It's a fairly simple thing to reverse the function, and you certainly should not use code you don't understand. Please read our forum charter [webmasterworld.com]. It has links to several resources you will find helpful, as well as some important information on our forum policies.

Alternatively, you can search WebmasterWorld for many examples of how to do the opposite rewriting function.

Jim