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

nam_co's avatar

htaccess to nginx

Hi, hope somebody can help me, in transforming my apache htaccess rules to nginx config

  1. removing the .php from the url's, so url: "/contac"t displays the file contact.php

  2. make this paths use their respective php file "/products" shows the file products-all.php "/products/some-category-name" shows the file products-cat.php "/products/some-category-name/product-name?id=89" shows the file products-detail.php

I tried searching everywhere, but couldn't fine the correct answer, appreciate any help

Thanks

0 likes
2 replies
Cronix's avatar

Step 1 should be done automatically by forge if you tell it it's a Laravel project. Is this a laravel project? It doesn't sound like it with all of the stuff you mention in step 2?

You could also try a converter, like: https://winginx.com/en/htaccess

nam_co's avatar

Hi cronix, thanks for the answer, it’s regular php (no framework)

I tried converters but they don’t work very well

Thanks

Please or to participate in this conversation.