can we make a new root directory in subfolder of main root directory?

aricstechnology

Registered
Mar 18, 2013
1
0
1
cPanel Access Level
Website Owner
hi,

i am the owner of website gamearics.com...now i want to make a new website for my friend (website name is bawawafers.com)..he approached me for domain name(which we already booked) and webspace .. ..but i already have a webspace which i am using for gamearics.com...i will do the following steps

1.)make a new folder of name of bawawafer and place all his files there..so that we can see all files in gamearics.com/bawawafers

2.)make an ftp server from cpanel for my friend to acess all his files in bawawafer folder.

3.)create an addon domain from cpanel

4.)give the dns address of my hosting server to domian name

so now the problem is that i dont know that whether when he opens bawawafer.com ...will he be directed to gamearics.com/bawawafer..? and if yes then will the url will open of gamearics.com/bawawafers or bawawafer.com

is it possible to have a root directory of bawawafers.com inside gamearics.com/bawawafer (folder name inside gamearics.com server)..so that if somebody types bawawafers.com in url box the index file will be opened from gamearics.com/bawawafers..and user or nobody knows that its inside gamearics server folder..

thanks in advance
 

quietFinn

Well-Known Member
Feb 4, 2006
2,020
541
493
Finland
cPanel Access Level
Root Administrator
You create the addon domain 1st, and set the root folder of it to public_html/bawawafer.
That creates the directory public_html/bawawafer and you can upload the files there.
It also creates a ftp account for that addon domain.
 

arunsv84

Well-Known Member
Oct 20, 2008
372
1
68
127.0.0.1
cPanel Access Level
Root Administrator
When he open bawawafers.com, he will be able to see the site directly. But if he try to access gamearics.com/bawawafers , it will open the same website without changing the url. Also there is a chance that search engines will index the url gamearics.com/bawawafers as well. You can avoid this by placing the following rules in .htaccess.

Please note in my example:

addondomain = Rootdomain name
the-hosting-domain = The domain name that hosts your add-on domain.

Here is what you need to put in you htaccess file in the directory that houses your add-on domain ie. www.the-hosting-domain.co.uk/add-on/

Options +FollowSymlinks
RewriteEngine OnRewriteCond %{HTTP_HOST} ^addondomain\.co.uk [NC]
RewriteRule ^(.*) http://www.addondomain.co.uk/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www.addondomain.the-hosting-domain\.co.uk
RewriteRule ^(.*)$ http://www.addondomain.co.uk/$1 [R=permanent,L]

RewriteCond %{HTTP_HOST} ^addondomain.the-hosting-domain\.co.uk
RewriteRule ^(.*)$ http://www.addondomain.co.uk/$1 [R=permanent,L]
And add this to the .htaccess file in the root domain: ie. www.thehostingdomain.co.uk

Options +FollowSymlinks
RewriteEngine OnRedirect /addondomain http://www.addondomain.co.uk
That should work!

Cheers!!!