skip to Main Content

I have a Laravel website that work perfectly on localhost but when i deploy that, there is a problem with loading assets or other files from public directory.

Bad Request
Your browser sent a request that this server could not understand.

It’s my apache vHost :

<VirtualHost IP:8181>
    ServerName my-domain.com
    ServerAlias www.my-domain.com
    ServerAdmin [email protected]
    DocumentRoot /home/user/public_html/laravel/public
    UseCanonicalName Off
    ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/

    ErrorLog /usr/local/apache/domlogs/my-domain.com.error.log

    <IfModule mod_setenvif.c>
        SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
    </IfModule>

    <IfModule mod_userdir.c>
        UserDir disabled
        UserDir enabled user
    </IfModule>

    <IfModule mod_suexec.c>
        SuexecUserGroup user user
    </IfModule>

    <IfModule mod_suphp.c>
        suPHP_UserGroup user user
        suPHP_ConfigPath /home/user
    </IfModule>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid user user
    </IfModule>

    <IfModule itk.c>
        AssignUserID user user
    </IfModule>

    <Directory "/home/user/public_html">
        AllowOverride All
    </Directory>

</VirtualHost>

And it’s apache log :

Invalid URI in request GET @backend HTTP/1.0

There is many laravel sites and all of them are normal but i have problem with this one. I can’t figure out this problem.
My vHost.conf is OK, my .env files is OK, but i can’t load any assets such as css / js / robots.txt / etc … ( anything that saved in public directory ).

Do you have any idea?

2

Answers


  1. I think changing

    <Directory "/home/user/public_html">
       AllowOverride All
    </Directory>
    

    to

    <Directory "/home/user/public_html/laravel/public">
       AllowOverride All
    </Directory>
    

    might help ?

    Login or Signup to reply.
  2. Change your document root to /home/user/public_html.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search