Serve PHP scripts in subdirectory

Hi!

We’ve migrated a client from a previous homepage to a Pimcore installation. They want to be able to serve a couple of old functions as simple PHP scripts in subdirectories. When I try to access these directories without adding a trailing index.php it just sends me to the 404 page.

I tried adding index.html and index.php to the DirectoryIndex directive in .htaccess but this didn’t work. What would be the solution?

Thanks!

Don’t do that. Better create a route for that old paths, and serve the content from within a proper controller.

Why is that? Since this is old code base that we are not responsible for I’d prefer not to integrate it within the Pimcore solution. In case you think it’s absolutely necessary I’d need arguments as to why that is so that I can tell the client and get resources for it.

Thanks!

Ok, in that case you propably need to change the nginx or apache configuration.

BTW: I would integrate that into Symfony for security reasons, so everything is servered from the Symfony Stack.

1 Like