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

Siddharth Shukla
1 min readFeb 10, 2020

--

Add this code in below within .htaccess file

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

to

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 a Debian based system such as Ubuntu. You can use the command

sudo a2enmod rewrite

Read More: https://realprogrammer.in/configure-clean-urls-for-laravel-using-a-rewrite-rule-to-index-php/

--

--

Siddharth Shukla
Siddharth Shukla

Written by Siddharth Shukla

I'm a Full Stack Engineer based in India ☀️, working at Kreativ Street. I'm a coding passion focused on Python, specifically Laravel & Django.

No responses yet