Configure clean URLs for Laravel using a rewrite rule to index.php

Pinterest LinkedIn Tumblr

Add this code in below within .htaccess file

RewriteRule ^(.*)$ index.php?/$1 [L]


RewriteRule ^(.*)$ index.php/$1 [L]

based on the example urls your provide. http://url.lar/index.php/about/ doesn’t have a question mark in it after index.php

It is also possible that mod_rewrite is not enabled. It looks like you are an a Debian based system such Ubuntu. You can use the command

 sudo a2enmod rewrite 
 enable mod_rewrite

Write A Comment