Question

Larvel issue of changing directory in a droplet

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

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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: