Forum Moderators: phranque

Message Too Old, No Replies

URL rewrite

         

bigsness

8:58 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



I was wondering if anyone had a good way to incorporate a rewrite with one I already have, I keep running into redirect issues.

Currently I have:

RewriteCond %{HTTP_HOST}!^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST}!^$
RewriteRule ^/(.*) [domain.com...] [L,R]

I need to be able to have it do something like this:

subdomain.domain.com redirects to [domain.com...]

Is there an easy way to do this without having to worry about creating virtual hosts?

bigsness

9:40 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



Not even a bite?

jdMorgan

12:48 am on Jul 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



bigsness,

Welcome to WebmasterWorld!

We have had several recent threads on rewriting subdomain requests to subdirectories [google.com]. You might want to review them, have a go at coding up a solution, and let us know the test results if ti doesn't quite work properly.

References to mod_rewrite documentation and information on how to use this forum are available in our Apache Forum Charter [webmasterworld.com].

Defining virtual hosts is the preferred method, but the threads I cited above provide an alternative if you don't have access to httpd.conf.

Jim