www.abc.net www.abc.net/admin its same domain /admin is a route
what you can do is make a subdoman admin.abc.net
and make a virtual host for admin.abc.net and point it to 2nd project
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hi all i had deploy my project successfully, now i have other laravel project and i want to deploy with the same domain
first project www.abc.net second www.abc.net/admin
how to do that??
www.abc.net www.abc.net/admin its same domain /admin is a route
what you can do is make a subdoman admin.abc.net
and make a virtual host for admin.abc.net and point it to 2nd project
create a folder /admin inside your root folder just repeat the same procedure as you have done with your main domain
@RUGIGURU - i did that but it doesn't work
what might be happening is for 2nd project your index.php is inside /admin/public/index.php to access it you have go to url abc.net/admin/public/index.php
solution
after making admin folder and putting all of your 2nd project code inside it. you have to change the location of index.php for 2nd project i.e move index.php of 2nd project from public folder to admin like this /admin/index.php
and you have to configure some setting so that your 2nd projects work after moving index.php.
in index.php
require __DIR__.'/vendor/autoload.php';
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
i put second project public folder into public-html/public-admin folder.
//1st project dir
app
public
config
admin
//2nd project dir
app
public
config
vendor
...
index.php// 2nd project index should not be in public
vendor
and so on
also you can use same vendor folder for both project to save disk space on server
@VAJID - it does't work. do i need to change something un virtual host?
@fatima1 what error you are getting no change is needed in virtual host
@VAJID - no error its only page not found
i think its looking for url /admin
try /admin/index.php or /admin/public/index.php
@VAJID - still the same inly page not found
now what i did is
//1st project dir
app
config
admin
//2nd project dir
app
config
vendor
...
vendor
public_html
1st project index.php
admin
2nd project index.php
it return this error
Warning: require(/home/abc/public_html/admin/../path/to/web/vendor/autoload.php): failed to open stream: No such file or directory in /home/abc/public_html/admin/index.php on line 24
in 2nd project change this line
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
Please or to participate in this conversation.