We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Removing index.php on NGINX

Development and Programming

Angie Herrera's avatar
Angie Herrera
365 posts
3 years ago
Angie Herrera's avatar Angie Herrera

I’m still new to NGINX and I primarily use it in my local environment. In this particular case, I have EE 6.3.4 running on NGINX using Laravel Valet. I can get to /admin.php without issue, but any frontend pages other than the home page (such as domain.test/bio) give me a 404 Not Found error. If I add index.php to the URL it works fine (e.g. domain.test/index.php/bio). Not ideal of course.

I found this forum thread from way back to try to remove index.php but it doesn’t work for me.

Here’s what the config for this particular site looks like (with domains stripped out for privacy)

       
Tom Jaeger's avatar
Tom Jaeger
449 posts
3 years ago
Tom Jaeger's avatar Tom Jaeger

Hi Angie,

Great question.

With Valet, I believe a lot of this comes down to your Valet driver and how it’s setup. (Side note, Valet driver is often found in ~/. config/valet/Drivers)

While I have a few changes to my driver locally… I believe this is method most closely related to removing the index.php. You may have to tweak the /public

public function isStaticFile($sitePath, $siteName, $uri)
    {
        if ($this->isActualFile($staticFilePath = $sitePath.$uri)) {
            return $staticFilePath;
        } elseif ($this->isActualFile($staticFilePath = $sitePath.'/public'.$uri)) {
            return $staticFilePath;
        }

        return false;
    }

If that doesn’t do the trick for you, it might be helpful to post your whole Driver so we can see whats cooking a bit better!

Cheers,

-Tom Jaeger

       
Angie Herrera's avatar
Angie Herrera
365 posts
3 years ago
Angie Herrera's avatar Angie Herrera

Thanks Tom - changing that function did the trick!

       
Wanda Anderson's avatar
Wanda Anderson
1 posts
2 years ago
Wanda Anderson's avatar Wanda Anderson

I am appreciative of the recommendation you have provided, thank you. Shell Shockers is a first-person fighting game that has been in production since 2017. It is a fantastic thing to have the opportunity to continue learning and to investigate new things even if one is taking a break. Shell Shockers was released in 2017.

       
kanecharles's avatar
kanecharles
5 posts
about 4 weeks ago
kanecharles's avatar kanecharles

Thanks for sharing the solution, Tom! For those still struggling with NGINX rewrites, sometimes a fresh approach helps—like how in Grow A Garden, small tweaks can lead to blooming results. If you enjoy calm, cozy games, you’ll love grow a garden. It’s easy to play and surprisingly addictive. I could spend hours building my dream garden!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.