Report this

What is the reason for this report?

Larvel issue of changing directory in a droplet

Posted on November 26, 2016

Hello I had larvel installed earlier in /var/www/HTML/ now I moved it in some other directory like /var/www/HTML/larvel/public, the larvel login is available at http://example.com/larvel/public but when I login it gets auto redirect to http://example.com/do-login not http://example.com/larvel/do-login , how can I change the base project directory.

Thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Sorry to see that your question hasn’t received an answer yet. Unfortunately, after this much time, it is unlikely an answer for this specific question will be provided without more information.

For people still landing here via search experiencing similar issues, the first place I would suggest to look is the the configuration for the web root in your web server. It should only point to the public/ folder, not the root of the application. For example, if your Laravel app is located at /var/www/html/laravel/ you config might look like:

Nginx:

server {
    listen 80;
    server_name example.com;

    root /var/www/html/laravel/public;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

Or with Apache:

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot "/var/www/html/laravel/public"

    <Directory "/var/www/html/laravel/public">
        AllowOverride all
    </Directory>
</VirtualHost>

Check out this tutorial for more info on getting a Laravel app up and running:

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.