skip to Main Content

So basically here’s my base directory on my server

/var/www/html/server

Where my laravel project is inside the server folder

If i access the site at https://www.sympies.net/server/public/ it redirects to https://www.sympies.net/public . I dont understand why. I removed the .htaccess inside the public folder already

Here’s my .htaccess code on laravel root folder

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<IfModule mime_module>
  AddType application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>

This one is for my

000-default-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combin
ServerName www.sympies.net
SSLCertificateFile /etc/letsencrypt/live/www.sympies.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.sympies.net/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Yesterday , the public folder works but only when i access it via http not https, and when i access it via https , it redirects again back to its root https://www.sympies.net/public

2

Answers


  1. Chosen as BEST ANSWER

    If someone will encounter this kind of error or bug, the answer is , you need to configure your server same to the configuration set by Laravel, [ [https://laravel.com/docs/6.x/deployment][1] ]


  2. Add server/public dir name to your DocumentRoot /var/www/html section like /var/www/html/server/public.

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