Help! Changed .htaccess file, now website won’t load!

I made changes to my .htaccess file, updating it from:

<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]

# Send Requests To Front Controller...

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index.php [L]

</IfModule>

to:

<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]

# Check if the requested file or directory exists

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

# If not, rewrite to the Vue.js front-end

RewriteRule ^ index.html [L]

</IfModule>

I tried changing it back to the original setup, but my site still isn’t loading. The console is full of errors, and I’m not sure what to do. Really need help!

Double-check that your .htaccess file is correctly restored and look for any syntax errors. Also, check the server’s error logs for clues on what might be going wrong.

Looks like you switched from index.php to index.html - was there a reason for this change?

If you’re using standard Apache, it should work as long as the syntax is correct. But if it’s something like OpenLiteSpeed, you’ll need to reload the webserver for changes to take effect.

If you can share any of the specific errors, that might help us troubleshoot better!

@Victor
Fixed it! I redirected the routes to index.html in Laravel, and now it’s working. Thanks for the help!

It’d help to know what the exact error was. Also, if you haven’t already, try reverting any recent changes to .htaccess.

Cameron said:
It’d help to know what the exact error was. Also, if you haven’t already, try reverting any recent changes to .htaccess.

Got it working! I redirected all routes to index.html in the backend and cleared the server cache. Thanks for your advice!