Laravel .htaccess not working - 404 Page not found

edited August 9 in Web Server
Update:
- Admin can save the rule, but the user not

I create subdomain (ex. sub.domain.com) with path "sub.domain.com/public", so i can install laravel in directory sub.domain.com.

When I'm go to sub.domain.com/login it shown 404 page not found. I think there is something wrong with the htaccess file, so I check it in subdomain launcher -> rewrite rule, but there is not, so I save it again and shown an error.

"Could not save rewrite rules. Error message: Websites matching query does not exist."

Here is the .htaccess file

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

RewriteEngine On

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

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

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

Comments

  • Hello @aris!

    This could be a minor bug, a patch will be released along with next update. If you have created child-domain exactly to the path of your Laravel installation, you can open File manager save your .htaccess file from there and then restart OpenLiteSpeed.
Sign In or Register to comment.
Support CyberPanel CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion