views:

57

answers:

2

I am using godaddy shared linux hosting and i hosted multiple domains in same package. Last week one of my wordpress sites was infected from an malware. Then this worm code seperated to my all domains instantly.

The quesiton is how can i forbid to access other domains (folders) from a domain (folder) with php.ini or any other solution ?

+1  A: 

I'd contact the godaddy support and inquire about using htaccess to restrict access.

gurun8
+1  A: 

I think your only chance to do that on shared hosting is the open_basedir setting.

In each web root, create a .htaccess file containing the following:

php_admin_value open_basedir /path/to/current/web/site

if this works, every fopen(), include() etc. access outside /path/to/current/web/site should fail with an error message.

It can be that your provider has disabled this possibility - if they have, it'll be silently ignored. It could also be that an open_basedir has already been set centrally for all your sites. That setting could be inherited, rendering any further settings moot. You'll have to try out.

Pekka
Hi Pekka thank you for your advice but after this modification my site down with "Internal Server Error" i asked to support the problem... and their response:"Dear Uchiha Itachi,I apologize for the confusion. php_admin_value open_basedir is not executable on our shared hosting environment.... bla bla ..." Is there a any way to doing this ?
Uchiha Itachi
@Uchicha sorry, I think in that case this is impossible to achieve. You would have to talk to Godaddy about making those settings, order separate hosting packages, or move to an ISP that supports the flag (or other means of separation between domains).
Pekka