I'm currently having an issue with redirecting a subdomain I've created and was wondering of anyone here could help.
Here's the scenario:
Domain is http://www.domain.com which contains index.php
Subdomain is test.domain.com
Creating this via the CPanel is all good and it created a directory: http://www.domain.com/test which contains an empty cgi-bin directory and a holder index.html file.
Browsing to test.domain.com works fine, the contents of index.html are displayed
I then create an index.php and place it in http://www.domain.com/test and remove the index.html file
Now, browsing to test.domain.com redirects to http://www.domain.com and loads the index.php file there.
I can't for the life of me understand why it is doing this, as it makes no sense to me. I've tried various settings in the .htaccess file from Google searches, but to no avail.
Can anyone help with this? Thanks in advance.
[SOLVED]Subdomain redirection problem
Moderator: General Moderators
[SOLVED]Subdomain redirection problem
Last edited by idevlin on Sun Aug 17, 2008 2:44 am, edited 1 time in total.
Re: Subdomain redirection problem
Subdomains on shared servers (cpanel) usually have a directory with a "public_html" directory of some sort. Is the directory where test.yourdomain.com in your public_html directory? It may be that you master domain is the default for your subdomains.
Re: Subdomain redirection problem
I have no idea if this will even make any difference but you can always try putting this in the htaccess file under /test
Code: Select all
DirectoryIndex index.php index.htmlRe: Subdomain redirection problem
It turned out to be Wordpress being daft and redirecting back to the main index.php rather than staying where it should have been in the subdomain.
Thanks for the replies though.
Thanks for the replies though.