.htaccess redirect non-existent directory to subdomain
Hi,
Im reorganising my web diretory because it's become messy. I've changed the structure of things so that folders below root are now subdomains e.g. http://domain.com/forums will now be at http://forums.domain.com. What I want to do is put a .htaccess redirect in place so that requests for the forums diretcory get routed to the subdomain. However the answers I've found on Google aren't working. The new directory structure is like this : Root -Main -Subdomains --Forums --Sub2 The domain is setup so that the directory "Main" is its root and that works fine. The problem is that trying to goto /forums 404s because the directory doesn't exist. Ideally I would like to have any request for a directory below root to be redirected to the subdomain directory automatically so I can add subdomain directories and they will automatically work if the directory exists. |
Since you have control of the server you should not use .htaccess.
Have a look at the rewrite module. It will let you do what you want. Try some things and let us know if isn't working. |
Hi,
If you have a couple of URLs that you want to redirect to subdomains according the requested URI, you can use: Code:
Redirect /forums http://forums.domain.com Regards |
All times are GMT -5. The time now is 03:59 AM. |