Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vpvijayanand's avatar

Is there a way remove index.php in Laravel without changing .htaccess

In our production server they have disabled .htaccess file to load in apache configuration for some security reasons, due to this all the URL's are added with index.php in addition.

Problem image url and curl request is not properly working due to the index.php added in addition to the url.

Is there are other way to do this.

0 likes
3 replies
kyslik's avatar

Use NGINX and you do not have to worry about .htaccess.

(obviously this is meant as a joke kind of answer which also carries a valid answer to the question)

SapporoGuy's avatar

Have them add it directly to the server config file.

Basically, my minor understanding to shut off htaccess to users is to prevent dumb people doing dumb things like screwing up the redirect to create loops. The biggest security issue I can think of is using the htaccess to point to dangerous files. But ... in this case, the hosting company already has trouble because ftp access has been gotten and a lot more could happen.

,Anyway, get them to add it to the config file directly which is actually the best way to do this.

Please or to participate in this conversation.