0

I just moved a homestead laravel installation to my own vps setup.

Everything is working fine on the homepage (XX.XX.XX.XX/public).

But when i click ay links on the homepage it goes to XX.XX.XX.XX/link instead of XX.XX.XX.XX/public/link as i whould think it should.

I have a local setup with homestead and a link like this one XX.XX.XX.XX/signin whould work fine.

And when i try XX.XX.XX.XX/public/signin on the vps it gives a 404 error.

In my sites-available i have setup the below .conf file.

<VirtualHost *:80>
        ServerName XX.XX.XX.XX/app.domain.dk
        DocumentRoot /var/www/app.domain.dk/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/app.domain.dk/public>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

What could be the problem, please help me : )

user3502250
  • 343
  • 1
  • 5
  • 18

2 Answers2

4

The problem is in wrongly configured web server. You should point web server to a laravel_project/public directory and use URLs like XX.XX.XX.XX/link instead of XX.XX.XX.XX/public/link.

For Apache you can use these directives:

DocumentRoot "/path_to_laravel_project/public"
<Directory "/path_to_laravel_project/public">

Don't forget to restart web server.

Community
  • 1
  • 1
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
0

Solved.

I figured out i was missing a forward slash in my .conf file.

So it should be /var/www/app.domain.dk/public/

Thanks for the help everybody :)

user3502250
  • 343
  • 1
  • 5
  • 18