Error 404 after configuring SSL in Apache

2

I have a VPS running CentOS 7 and an Apache server, and I have a site in it, working perfectly inside the / var / www / html / mysite folder. But this using HTTP. I then decided to generate an SSL to run the site on HTTPS. From then on, the site runs using HTTPS, but only the home page. The rest of the pages do not load, give me a 404 error (Example: "The requested URL / admin was not found on this server").

So here's my .htaccess:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

My VirtualHost in httpd.conf:

<VirtualHost *:80>

ServerName www.meusite.com.br

ServerAdmin [email protected]
DocumentRoot /var/www/html/meusite/public

<Directory /var/www/html/meusite/public>
    AllowOverride All
</Directory>

I'm breaking my head to find the mistake but I have no idea what it can be. Does anyone have any ideas? Thanks!

    
asked by anonymous 18.02.2017 / 17:03

1 answer

0

I was able to answer my problem, so I'll leave the solution here, if someone has the same problem. I am using the Laravel framework, and it seems that in case you use this framework, it is good to add the following code block in the ssl.conf file:

<Directory /var/www/html/seuprojeto/public>
   AllowOverride All
</Directory>

I did this and it worked out right. The whole site runs, with no 404 error.

    
20.02.2017 / 01:45