Forum Moderators: phranque

Message Too Old, No Replies

Rewrite for use subdomain as master

         

webstyler

8:13 am on Jun 29, 2010 (gmt 0)

10+ Year Member



So

I have a main site in www.example.com
I have develop new WP site on site.example.com (cpanel virtual subdomain)

Now, I would like that site.example.com resolve as www.example.com

any suggest ?

Thanks

webstyler

8:22 am on Jun 29, 2010 (gmt 0)

10+ Year Member



uhm.. may be not clear :)

I need that when user digit www.example.com view site.example.com content
They must not redirect to /site but view as is www.example.com page..

so www.example.com/faq.html is really under site.example.com/faq

thanks

g1smd

10:05 pm on Jun 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What have you tried so far?

Are you on shared hosting?

webstyler

6:24 am on Jun 30, 2010 (gmt 0)

10+ Year Member



solved with

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subdomain/$1

:)

g1smd

7:12 am on Jun 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



VERY inefficient code that will beat your server hard drive to death very quickly.

Add the [L] flag to the Rule and check preceding forum topics for other ways to do this, ways that do not involve those expensive -f and -d "exists" checks.