Saturday, February 26, 2022

[FIXED] Laravel default .htaccess file will not work

Issue

I finally got everything installed for Laravel, but I am getting an error 500 on my home page!

It looks to be my .htaccess file. If I remove it the page works. If I put it back, another error 500.

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On

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

If I change that second to last line to "RewriteRule ^index.php [L]" (no space before index.php) then the error 500 goes away but the rewrite rule will not work.

My host is 1and1.com.

Can anybody help me?


Solution

Changed this line:

    RewriteRule ^ index.php [L]

to this:

    RewriteRule ^ /index.php [L]

Now it works. Not only do I not get the 500 error, but the URLs appear to work as intended.



Answered By - JLZenor

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.