Prevent open website from IP
Hi.
I have a dedicated server for my website.
Today I created a subdomain with CNAME (Advanced Editor Zone).
but when Im opening the subdomain (for expamle sub.domain.com), its redirected to sub.domain.com/cgi-sys/defaultwebpage.cgi.
so I searched and find this soloution: in /usr/local/apache/conf/httpd.conf changed DocumentRoot to /home/account/public_html.
my problem solved and subdomain opened my subdomain correctly.
but now when a user enter server IP, the website opened (/home/account/public_html).
How can I prevent opening website with server IP?
-
Pardon me for asking what may be a silly question but: [QUOTE] Today I created a subdomain with CNAME (Advanced Editor Zone).
Why? I suppose there's a reason you did, I'm just not sure what it would be offhand. [QUOTE]so I searched and find this soloution: in /usr/local/apache/conf/httpd.conf changed DocumentRoot to /home/account/public_html.
You can change to doc root in the same area you created the sub domain. There should be no need to do this. You might want to reverse any changes you made in all areas and give it another go, using the proper tools you have in cPanel.0 -
[quote="Infopro, post: 1641882">Pardon me for asking what may be a silly question but: Why? I suppose there's a reason you did, I'm just not sure what it would be offhand. You can change to doc root in the same area you created the sub domain. There should be no need to do this. You might want to reverse any changes you made in all areas and give it another go, using the proper tools you have in cPanel.
Thanks for your help. For some reasons I want our visitors can access our domain content from subdomain, without redirect. So I created a CNAME for this. In Advanced DNS Zone Editor there is an option for this? I create cname with these data: Name: sub.domain.com TTL:14400 Type:CNAME CNAME:domain.com but sub.domain.com redirected to cgi-sys/defaultwebpage.cgi before changing httpd.conf.0 -
[QUOTE]For some reasons I want our visitors can access our domain content from subdomain, without redirect.
What redirect do you speak of? Creating a sub domain in cPanel should work as expected. But since you mention a redirect, I have to assume (since I'm not sure what the issue is here exactly) you're not setting up a sub domain on the same server as the main domain. Or am I mistaken?0 -
[quote="Infopro, post: 1641912">What redirect do you speak of? Creating a sub domain in cPanel should work as expected. But since you mention a redirect, I have to assume (since I'm not sure what the issue is here exactly) you're not setting up a sub domain on the same server as the main domain. Or am I mistaken?
"Without Redirect" means when users going to sub.domain.com, the page doesn't redirect to domain.com. Instead of this, when user going to sub.domain.com can explore website with this links for example: sub.domain.com/index.php, sub.domain.com/dir/index.php. for this, I created CNAME.0 -
Hello :) If it's a shared IP address, you can sometimes ensure it loads the default cPanel page by running the following command: /scripts/rebuildhttpdconf
Otherwise, follow the instructions here: Default page for IP Address Thank you.0
Please sign in to leave a comment.
Comments
5 comments