Is your APP_URL set to localhost in the .env file? Change it to the right url.
Wrong URL
I have all the time the same problem.
I have a virtual host syworkx.local with xampp. When I put syworkx.local or localhost in chrome everything works great. There is a login panel. I put login and password and I am redirect to https://localhost/dashboard/. But the right url is https://syworkx.local/dashboard/. What is wrong?
I have many local domains in hosts and httpd-vhosts.conf. How can I setup all to work separately?
Thanks for the help. Martin
APP_URL=localhost
It is my line.
But why I have no different when I put localhost or syworkx.local?
There is my .env
APP_ENV=production APP_DEBUG=true APP_KEY=3wtKR5gTkgcpA9PGhEEm8Dx5ItVCMFtC APP_URL=localhost
Martin
check your virtual host configuration.
httpd-vhosts.conf:
<VirtualHost *:80> ServerAdmin [email protected] (here is my email address) DocumentRoot "C:/xampp/htdocs/syworkx/public/" ServerName syworkx.public ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common
host:
127.0.0.1 localhost ::1 localhost 127.0.0.1 buchhaltung.local 127.0.0.1 manager.local 127.0.0.1 statistics.local 127.0.0.1 holidays.local 127.0.0.1 warehouse.local 127.0.0.1 rent-home24.com.local 127.0.0.1 www.rent-home24.com.local 127.0.0.1 prestashop.local 127.0.0.1 xdebug.local 127.0.0.1 blog.local 127.0.0.1 supply.local 127.0.0.1 usersmanagement.local 127.0.0.1 buchhaltung.local 127.0.0.1 ninja.local 127.0.0.1 cryptomator-vault 127.0.0.1 syworkx.local
Martin
Change the APP_URL to the right domain and compare your vhost + windows hosts file settings against these posts on StackOverflow:
You have to use APP_URL=localhost as like below,
APP_URL=127.0.0.1
and what you get when run below command in your CMD,
php artisan serve
I put your text, restarted xampp and next run command from powershell directly from syworkx directory but it made no chnge. Everything is the same.
Does Somebofy has a different idea?
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName syworkx.public
DocumentRoot "C:/xampp/htdocs/syworkx/public/"
<Directory "C:/xampp/htdocs/syworkx/public/">
DirectoryIndex index.php
</Directory>
</VirtualHost>
can you rewrite it and check?
Use below command to clear your caches,
php artisan cache:clear
php artisan route:clear
php artisan view:clear
In your app url as like keep,
APP_URL=syworkx.local
can you show your config/app.php?
I rewrite it, restarted xampp and no changed. Everything is the same.
My config/app.php:
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'APP_URL',
Do you need all file or it is enough?
You have to configure as like below,
'url' => env('APP_URL', 'http://syworkx.local'),
which is right?
<VirtualHost *:80> ServerAdmin [email protected] ServerName syworkx.public DocumentRoot "C:/xampp/htdocs/syworkx/public/" <Directory "C:/xampp/htdocs/syworkx/public/"> DirectoryIndex index.php
or
<VirtualHost *:80> ServerAdmin [email protected] ServerName syworkx.local DocumentRoot "C:/xampp/htdocs/syworkx/public/" <Directory "C:/xampp/htdocs/syworkx/public/"> DirectoryIndex index.php
After: php artisan cache:clear php artisan route:clear php artisan view:clear
I put:
PS C:\xampp\htdocs\syworkx> php artisan serve Laravel development server started on http://localhost:8000/
Can you marked as solved the others could able to find the answer check anyone reply right hand corner there are best answer button click on that.
Ok, but the problem is not solved. My offline site doesn't work all the time.
I will put "best answer" when it will be solved.
Martin
Please mark as solved if it is solved
OK, but the problem is not solved all the time.
I don't know why localhost and syworkx.local has the same result? Maybe here is the problem?
Every laravel website open dashboard from localhost/dashboard not from from directory with project!!!!!
I know it is the problem but I can't find the solution for it. Online everything works very good.
Please help me!!!!
I have many projects in \xampp\htdosc not only one.
I have many local domains. It is the reason why must be the different between local host and syworkx.local.
Martin
xampp\htdocs\index.php
""<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit; ?>""
Maybe there is a problem here?
your virtual host settings need unique domain name, eg syworkx.local
app_url needs that same name
Access your site with this domain name. All requests turn up at the same web server and the server uses host headers to know which of your vhosts to use
Check what you have in redirect link
I have in .env:
APP_ENV=production APP_DEBUG=true APP_KEY=3wtKR5gTkgcpA9PGhEEm8Dx5ItVCMFtC APP_URL=syworkx.local
but it doesn't work. I have the same when I type localhost and syworkx.local.
The homepage is ok but after login a have a dashboard from C:\xampp\htdocs\dashboard not from C:\xampp\htdocs\syworkx\resources\views\dashboard. How can I fix this redirection?
Please or to participate in this conversation.