toolman Posted October 30, 2014 Share Posted October 30, 2014 Hi, I have an address on my main server http://www.website.com/directory and would like to redirect it to a subdomain http://subdomain.website.com/directory The subdomain is not pointing to the same server as the main domain. How would I set up a redirect in htaccess? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/292158-redirect-main-domain-to-subdomain/ Share on other sites More sharing options...
requinix Posted October 30, 2014 Share Posted October 30, 2014 You're using IIS so you don't have a .htaccess. Unless you managed to post in the complete opposite forum than you should have. How to redirect in IIS Quote Link to comment https://forums.phpfreaks.com/topic/292158-redirect-main-domain-to-subdomain/#findComment-1495297 Share on other sites More sharing options...
toolman Posted November 7, 2014 Author Share Posted November 7, 2014 Hi, I think I may have got confused. I have a sitebuilder script that creates micro sites on the same domain - eg: www.website.com/micro1. The script basically clones the homepage and allows me to change some colors etc. When the micro site is set up, it creates a redirect www.website.com/micro1 which goes back to www.website.com, but with the adjusted colors. What I want to do is to redirect www.website.com/micro1 to another url, for example http://sitebuilder.website.com/microsite1 I have discovered that there is no actual /micro1 folder in my root which is why the following redirect does not work: Redirect 301 /micro1/ http://sitebuilder.website.com/microsite1 However, if I create a /micro1 folder in my root, the redirect works. I have a lot of sites, so I don't want to create folders for each microsite. Is there another redirect I can do so I don't have to create a folder each time? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/292158-redirect-main-domain-to-subdomain/#findComment-1496008 Share on other sites More sharing options...
requinix Posted November 8, 2014 Share Posted November 8, 2014 A lot of this depends on how the sitebuilder thing sets up the redirects. What do you know about that? Or maybe, what script thing are you using so we can find it ourselves? Quote Link to comment https://forums.phpfreaks.com/topic/292158-redirect-main-domain-to-subdomain/#findComment-1496063 Share on other sites More sharing options...
kpmedia Posted December 18, 2014 Share Posted December 18, 2014 That redirect does not work because it's not an IIS redirect. You have two choices: 1. Buy Micronovae IIS Mod Rewrite for the server (dedicated or VPS only) which then allowed most htaccess to work on IIS. 2. Convert it to an IIS rewrite using the conversion tool in the IIS Manager (only available to the server admin). If not a server admin with "root" privileges, then you'll need to read some help docs online. Or ask here. But first, yoiu need to create a mod_rewrite rule, not a pure htaccess rule. Those don't work at all. Quote Link to comment https://forums.phpfreaks.com/topic/292158-redirect-main-domain-to-subdomain/#findComment-1499994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.