3

been searching for fixes and tried everything i can. just signed up cause I can't work out my problem, so this is my last resort.

here's the thing i have a project named 'website.dev' then i want to have a subdomain 'admin.website.dev' so basically it's just an admin dashboard and everything else.

as for the routings i have this.

Route::group(array('domain' => 'admin.website.dev'), function(){
Route::get('/', function() {
    return 'Hello from admin.website.dev!';
});
});
Route::group(array('domain' => 'website.dev'), function(){
Route::get('/', function () {
    redirect('/centralapp');
});
});

I think there's no problem with my routings, from my research they changed there .htaccess or httpd.conf, I did all the things including putting 'admin.website.web' to system32/drivers/etc/host but still it can't read the subdomain. please help :/

btw I'm using Laragon as my LAMP Server.

davejal
  • 6,009
  • 10
  • 39
  • 82
  • 1
    Not sure how Laragon handles virtual hosts, but for `admin.website.dev` to work you should setup a separate virtual host, or add this line to your `website.dev` virtual host file: `ServerAlias admin.website.dev`. Only adding it to the `system32/drivers/etc/hosts` file will not make it work just because its a subdomain. – Bogdan Dec 05 '15 at 03:53
  • @Bogdan, could you write your answer, so the OP can accept – davejal Dec 05 '15 at 11:07

2 Answers2

1

I know it might be too late but you need to edit your virtual hosts file as well as your windows hosts file (which you seem to have done already.)

You can find your virtual hosts file in:

C:{laragon installation directory}\bin\apache\apache-2.4.17\conf\extra\httpd-vhosts.conf

Add the following:

<VirtualHost *:80> #your magic! If you use a different port then you will have to change it from *:80 to *:{Your port}
    DocumentRoot "{Your website directory path goes here}"
    ServerName admin.website.dev
</VirtualHost>
user3718908x100
  • 7,939
  • 15
  • 64
  • 123
0

You have two routes pointing to / Route::get('/' . Comment one out and try the other and then the other way around and see if this solves your problem. if so rename one of the to /renamed

replace rename with the route you want

davejal
  • 6,009
  • 10
  • 39
  • 82
  • Those `/` definitions are each in it's own domain group definition, which means they will not override one another. – Bogdan Dec 05 '15 at 03:43
  • exactly my thought @Bogdan, it still doesn't go to subdomain it still says 'The requested URL / was not found on this server.' but the 'website.dev' just works fine tho – vincent florence Dec 05 '15 at 03:58