Forum Moderators: phranque

Message Too Old, No Replies

need help for a subdomain rewriting

         

phph

6:13 am on Jun 1, 2006 (gmt 0)

10+ Year Member



Hey everyone,

I need some help with mod rewrite - want to do the following:

[subdomain.site.com...] to
[subdomain.site.com...]

I managed to do this for the root domain, but couldn't make it to work for the subdomain in the same way. Also, where do I put the rules? In .htaccess in the subdomain directory, or in the .htaccess in the root directory?

Any help is greatly appreciated!

jdMorgan

8:50 pm on Jun 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer depends on how you set up the subdomains. If each subdomain is pointed to a separate subdirectory as is typical with cPanel, then you'd put the rules in the .htaccess file in each subdoamin's subdirectory. However, if all subdomains point to your main domain's top-level directory, then you could put the code there, or optionally in each subdomain's subdirectory.

A search on WebmasterWorld for "subdomain subdirectory rewritecond http_host rewriterule" will provide a fairly-well-filtered list of previous threads on this subject.

Jim