O'Reilly logo

Learning Laravel 4 Application Development by Hardik Dangar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up .htaccess based on your server

Laravel does come with default .htaccess in your public folder which removes index.php from the URLs but different server configurations have different values. So if your server doesn't work with the default .htaccess, here is the .htaccess configuration you can try:

Options +FollowSymLinks
RewriteEngine On

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

If you are using hostgator as your server, then you would need to add the following line in your .htaccess file:

AddType application/x-httpd-php53 .php

This allows you to run your site in PHP 5.3, as by default sites will run in the older version of PHP as Laravel requires minimum PHP 5.3 Version. Similarly, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required