webtester01 Posted February 19, 2010 Report Share Posted February 19, 2010 Let's say I have two domains. http://domainA.com and http://domainB.com domainA is merely use as a 301 redirect to domainB. So, I want to use domainA to create virtual subdomains -- is this possible? For example, http://testing.domaina.com would redirect to http://domainb.com/blog/testing I used the code below (as a hypothetical example), but it didn't work. I tested http://testing.domaina.com but it gives me an error (page not found). RewriteCond {HTTP_HOST} !^domaina.com$ RewriteCond {HTTP_HOST} ^([a-zA-Z]+).domainb.com$ RewriteRule ^.*$ http://domainb.com/blog/%1 The other way is to manually create a subdomain on domaina.com each time by logging into Cpanel, but I don't want to do that each time for hundreds of subdomains. Quote Link to comment Share on other sites More sharing options...
Tony Posted February 19, 2010 Report Share Posted February 19, 2010 Did you make sure to setup a wildcard subdomain in cPanel? You need to do this so putting * instead of subdomain. Then you set it to a document root folder then you can actually work with mod_rewrite to send it to specific internal url's. Quote Link to comment Share on other sites More sharing options...
webtester01 Posted February 19, 2010 Author Report Share Posted February 19, 2010 Didn't work. I went to cpanel > Subdomains. Let's say my main domain is maindomain.com I see that there's domaina.maindomain.com So, for the subdomain input text, I put * and the document root is public_html/ domaina.com will contain the .htaccess of my script. I tested http://testing.domaina.com but got a page not found error. Quote Link to comment Share on other sites More sharing options...
Tony Posted February 19, 2010 Report Share Posted February 19, 2010 Did you allow for DNS propagation? Or was it simply a page not found displayed by the server? It might be best though if you make a support ticket someone might be able to assist you. Tough to offer advice when don't know your actual account. Quote Link to comment Share on other sites More sharing options...
webtester01 Posted February 21, 2010 Author Report Share Posted February 21, 2010 Thanks Tony "Hawk" Baird! The web skating man! Quote Link to comment Share on other sites More sharing options...
Cody R. Posted February 21, 2010 Report Share Posted February 21, 2010 Thanks Tony "Hawk" Baird! The web skating man! I'm assuming it's working then? 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.
Note: Your post will require moderator approval before it will be visible.