joefish Posted February 1, 2007 Share Posted February 1, 2007 (edited) I use my domain primarily to host a blog, which is located in http://foo.com/blog/. I use a redirect from http://foo.com/ to http://foo.com/blog/. Everything works great with this until I add a subdomain. When I access the subdomain http://subdomain.foo.com/, that also redirects to http://foo.com/blog/. The redirect rule I'm using is one I created through the cPanel wizard: >RedirectMatch temp ^/$ http://foo.com/blog/ How can I redirect root to a folder without breaking subdomains? Edited to add: BTW, I'm certain it's the redirect rule that's causing the problem. When I remove the root-to-folder redirection, subdomains work just fine. Edited February 1, 2007 by joefish Quote Link to comment Share on other sites More sharing options...
click Posted February 1, 2007 Share Posted February 1, 2007 (edited) Try replacing the RedirectMatch in .htaccess with the following: >RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?foo.com$ [NC] RewriteRule ^$ /blog/ Edited February 1, 2007 by click Quote Link to comment Share on other sites More sharing options...
joefish Posted February 1, 2007 Author Share Posted February 1, 2007 Works a treat, click. Thanks! Quote Link to comment 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.