dr.pepper Posted April 26, 2010 Share Posted April 26, 2010 Ive got a website with a subdomain and I want to change the homepage for the subdomain. I.e www.website.com goes to www.website.com/index.php, however when I go to the subdomain I want the homepage to show a different page. Ie I want test.website.com to go show test.website.com/test/index.php Is this possible? Quote Link to comment Share on other sites More sharing options...
cags Posted April 26, 2010 Share Posted April 26, 2010 Showing a different page is possible, do you really want to show a page that's actually in a different folder though, that sounds strange to me? If the file is in the same folder you can use the DirectoryIndex directive, not sure it will work for a file outside the folder though. You could probably achieve the result with mod_rewrite using something like... RewriteCond %{HTTP_HOST} ^test\.website\.com$ RewriteRule ^$ http://test.website.com/test/index.php I guess it depends on your overall objective. Quote Link to comment Share on other sites More sharing options...
dr.pepper Posted April 26, 2010 Author Share Posted April 26, 2010 Showing a different page is possible, do you really want to show a page that's actually in a different folder though, that sounds strange to me? If the file is in the same folder you can use the DirectoryIndex directive, not sure it will work for a file outside the folder though. You could probably achieve the result with mod_rewrite using something like... RewriteCond %{HTTP_HOST} ^test\.website\.com$ RewriteRule ^$ http://test.website.com/test/index.php I guess it depends on your overall objective. I want the subdomain to show a different homepage to the main website. The main websites homepage is /index.php and I want the subdomain to land on /test/index.php. It doesnt matter if it simply re-directs to test.website.com/test/index.php but it would be better if it could land on test.website.com but show /test/index.php. Hope that makes sense. Cheers Quote Link to comment Share on other sites More sharing options...
cags Posted April 26, 2010 Share Posted April 26, 2010 No it doesn't really make sense, because a sub-domain should point at a different folder to your root anyway, so it's index page should be the index.php file that is in that folder, unless you are trying to 'fake' sub-domains with mod_rewrite. How have you set the sub-domain up? 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.