0

Request routes aren't found after I made a change in the .htaccess file within Cpanel. Below is my .htaccess file, which redirects to the /public folder.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?omnisnco.com/
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public/$1
RewriteCond %{HTTP_HOST} ^(www.)?omnisnco.com$
RewriteRule ^(/)?$ public/index.php [L]

And after doing this, my request routes are not being found!

Error message

The requested URL was not found on this server. An error was encountered while trying to use an ErrorDocument to handle the request.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95

1 Answers1

-1

Could you see the logs? /var/log/apache/access.log or in /var/log/apache2/access.log The details could help you debug the error.

Based on this answers, you can try these lines:

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

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Fauzi Fadillah
  • 159
  • 1
  • 5