I am having a scenario that if URL doesn't contain anything in URI segment then no need to rewrite to index.php but if contains then rewrite it.
For Example: http://www.example.com/ or http://www.example.com No Rewrite Rule Required
But if URL is http://www.example.com/homepage or http://www.example.com/user/1 or http://www.example.com/edit-user/123/456 then it should be rewrite to index.php
I tried below.
<rules>
<rule name="custom rule 1" stopProcessing="true">
<match url="^([^/]+)/?$" />
<action type="Rewrite" url="index.php" />
</rule>
It is working for http://www.example.com/ and http://www.example.com/homepage but showing 404 for others pages.
The URI segments are dynamic and it can be multilingual.
Technologies used IIS, PHP (Laravel)