Skip to content

Instantly share code, notes, and snippets.

@andreyuhai
Last active January 8, 2019 23:47
Show Gist options
  • Save andreyuhai/0e2abdaf66da03fe1e6c5c4ee590dbee to your computer and use it in GitHub Desktop.
Save andreyuhai/0e2abdaf66da03fe1e6c5c4ee590dbee to your computer and use it in GitHub Desktop.
How to setup an alias for laravel project

How to set up an alias for your laravel project in a folder other than /var/www/html

Put your alias configuration in /etc/apache2/mods-enable/alias.conf

Alias /alias "/home/user/your_laravel_project_folder_/public"

    <Directory "/home/user/your_laravel_project_folder_/public">
            Options Indexes FollowSymLinks Includes ExecCGI MultiViews
            AllowOverride All
            Require all granted
    </Directory>

After that it should be working fine.

If you are getting 404 Page Not Found error then you might be missing this:

sudo a2enmod rewrite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment