Monica
Monica

Reputation: 1534

How do I configure Laravel to properly work on localhost?

So I have this website, that some else build on Laravel. Since I need to make some changes I want to copy this website locally and make it work locally, so that later on I can apply the changes. I really don't want to work on the live site.

So I copied the whole website in my local folder but in order for me to see each page I have to follow this link:

http://localhost/XXXproject/html/index.php/auth/signin

I would like to know, where can I fix this. I want to remove the index.php from the url and be able to see the images without getting 500 errors everywhere. Something more like this:

http://localhost/XXXproject/html/auth/signin

And this is my htaccess.

RewriteCond %{REQUEST_URI} !^/html
RewriteRule ^(/?)(.*) /html/$2

Upvotes: 0

Views: 1083

Answers (2)

Monica
Monica

Reputation: 1534

Finally I solved it, I went through the installation and configuration steps from the website, and realize that I was working with a htaccess that was under wamp\www folder, I even tried making one for wamp\www\xxxproject.

But when following the steps I realized there is a htaccess inside the public folder from the project, I changed that one with the one from the website and now it works!

Upvotes: 0

JaTochNietDan
JaTochNietDan

Reputation: 1063

During development I would recommend using Laravel's little HTTP server which will host the site without any external web server software such as Apache, where configuration might be an issue.

You can do this by going into the root directory of the project and typing:

php artisan serv

However if you do want to use a webserver for local development purposes with Laravel 4, you'll need to configure the rewrite rules appropriately. Although it does seem the rewriting is working to some extent, you may need to configure your webserver to consider index.php as a root document. Can't really help you more than that without more information on your webserver software and its current configuration.

Upvotes: 2

Related Questions