Forum Moderators: phranque
I have hosting package allows me to host multiple domains. Now I am hosting one few sites: friends and one is for NGO.
All domains are pointed to subfolder example: mydomain.com/site1, mydomain.com/site2 etc.
I just discovered that via certain php coding they can easy access to the root.:o I am very worried - they could erase something by mistake. They can access to the root only when opening their site using: mydomain.com/site1/. If they going thought their domain than they can't access to the root.:(
I don't know much about apache directives but I am learning.:)
Could someone tell me is how to forbid people from accessing to their site over my domain (mydomain.com/site/). I want them to go over their domain (which is pointed to their folder) or via site.mydomain.com.
Thank you.;)
The mod_rewrite code to do that is included in many posts here; Try searching WebmasterWorld for "redirect direct client requests" as a quoted string. Some threads are about mapping subdomains to subfolders, others are about mapping multiple "add=on" domains to subfolders. Your problem is the second of these.
Jim
I spent hours trying to understand whole concept.
Finally here is what I made:
Options -Indexes +FollowSymLinks
IndexIgnore */*
DirectoryIndex index.php index.html index.htm
RewriteEngine On
redirectMatch permanent ^/subdomain(/.+)?/?$ http://subdomain.mydomain.com$1/
Be advised that I am still learning and trying to understand how it works.
Is this what I am using proper solution? As far as I could test - it works but I am not sure is this correct way.
Thank you for your help:)