Temporary url of any account redirect to root account

psytanium

Well-Known Member
Jun 6, 2014
322
20
68
Lebanon
cPanel Access Level
Root Administrator
Hello,

I'm running a VPS server, I created an account "testacc", to try the temporary url usage, I leave it empty without any content.

Temporary url to "testacc" should be like this according to my hosting provider:
http://198.x.xxx.xx/~testacc/

When I open the temporary URL, it redirect me to the root account, I mean it load the content of the root user.

I discussed this problem with the hosting support, they are unable to solve it.

Seems to be a frustrating problem. this was the last reply from my hosting support.

Please I need your help.

Thank you.
 

SS-Maddy

Well-Known Member
Mar 28, 2009
130
18
68
cPanel Access Level
Root Administrator
This may be due to the absence of "mod_userdir protection" . Also if the server is running FastCGI as PHP handler, it is not possible to run PHP files via temporary url such as http://SERVER_IP/~username/index.php . But you will be able to view HTML files. Make sure that the IP used in the URL is confgured for shared hosting using the directive "Name VirtualHost"
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

Try updating the hosts file on your computer so that it points the domain name to the IP address of the new server. This will allow you to visit the domain name directly in your web browser before propagation occurs.

hosts (file) - Wikipedia, the free encyclopedia

Apache Mod_Userdir can sometimes conflict with certain configurations or Mod_Rewrite rules.

Thank you.
 

psytanium

Well-Known Member
Jun 6, 2014
322
20
68
Lebanon
cPanel Access Level
Root Administrator
mod_userdir protection was not enabled, i turn it on and tried to access again, same result, it will load the content of root user.

also i uploaded a plain text tohttp://198.x.xxx.xx/~testacc/ok.txt but same result, the root account load.

thank you for pointing me to the mod_userdir protection as i'm completely new here. if you have more possibilities let me know please.

- - - Updated - - -

Well, i need to load the content on my clients computers. but i tried your suggestion, i added this line to the host file in windows: # 198.1.124.74 testacc.com

also didn't displayed the content. something wrong ?

- - - Updated - - -

Make sure that the IP used in the URL is confgured for shared hosting using the directive "Name VirtualHost"
i don't know i feel this is the reason, can you explain more ? can i configure it from the WHM GUI ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Well, i need to load the content on my clients computers. but i tried your suggestion, i added this line to the host file in windows: # 198.1.124.74 testacc.com
You should not have the "#" symbol in the entry. That disables the entry.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I am happy to see you were able to resolve the issue. Thank you for updating us with the outcome.