Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

muhdbasiir's avatar

What is default htaccess for public folder in laravel?

Hi. Recently our server got hacked, the index.php and .htaccess is corrupted. Anyone can help me give me the default file for the htaccess?

Thank you.

0 likes
3 replies
muhdbasiir's avatar

Tried to find the solution but does not have recent threads.

muhdbasiir's avatar
RewriteEngine On

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

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

I found the solution. Thank you.

Please or to participate in this conversation.