2

On my hosting account, I created a new subdomain in cpanel. Let's say, beta.mydomain.com.

When I try to access beta.mydomain.com it works perfectly. However, when I try to access beta.mydomain.com, it redirects me to beta.mydomain.com/cgi-sys/defaultwebpage.cgi

How do I fix this?

Edit:

It appears the .htaccess at the root of the webserver might have something to do with this as well. The rules are as follows:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/beta/index\.php$
RewriteRule ^(.*)$ /beta/index\.php [R=302,L] 

If I type in beta.domain.com/somedirectory, I get redirected to domain.com/beta/index.php because of the rules. How do I exclude beta.domain.com from the above rewrite rules?

1 Answer 1

8

Did you visit the subdomain before you added it in cpanel? If so, your browser might be caching the "<html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=/cgi-sys/defaultwebpage.cgi"></head><body></body></html>" bit cpanel serves if you visit an unknown hostname. You could try removing the cache or test it with another browser (or even with wget/curl). If apache actually still serves the default html, check if the subdomain is created properly.

6
  • Ok, further to the above edit, you're right - accessing from another computer just redirects me to domain.com/beta/index.php. Can you please help with the .htaccess rules? Jun 27, 2011 at 20:57
  • Sorry about the late response. You were right, it was a caching issue! Jul 10, 2011 at 5:52
  • glad i saw this post before i was going to start looking at and playing with httpd.conf
    – Angry 84
    Feb 7, 2015 at 13:13
  • I know we shouldn't post thank you comments, but after losing 3 hours of my life, I really have to say thank you! Mar 22, 2016 at 21:48

Not the answer you're looking for? Browse other questions tagged .