I have a solution
I have a solution!
here's how to do that with Direct Admin:
- create a subdomain in Direct Admin example: sub.example.com
- you have a subfolder in public_html, delete that folder with the contents
- chmod only the public_html folder to 777 to create the symlink
- create a symlink between public_html and the name of the sub = sub
upload ln.php to the public_html folder and go to
http://www.example.com/ln.php
- make a new database in Direct Admin
- copy the /sites/default folder to /sites/sub.example.com
- edit settings.php and correct the database settings
- go to
http://sub.example.com, you get errors with table not found, that's good!
- go to
http://sub.example.com/install.php and run the install
- That's it!
- to delete a link upload unlink.php to public_html folder
- chmod only the public_html folder to 777
- run
http://www.example.com/unlink.php and that's it.
Here's the php code to create the symlink:
<?php
$target = '/home/username/domains/example.com/public_html/';
$link = '/home/username/domains/example.com/public_html/sub';
symlink($target, $link);
echo readlink($link);
?>
Here's the code to unlink the symlink:
<?php
//set the name of the link
$link = "dev";
//remove the symbolic link we created before
unlink("/home/username/domains/example.com/public_html/{$link}");
?>