PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 26, 2022

[FIXED] Laravel default .htaccess file will not work

 February 26, 2022     .htaccess, laravel     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

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

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing