php - Seo Friendly URL with Rewrite


I have a links on my site like;

campaigns.php AND product.php?id=5

After some research, i have converted them to;

campaigns AND product?id=5

With this 2 rule:

                <rule name="hide.php" enabled="false">
                    <match url="^(.*)$" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <add input="{REQUEST_FILENAME}.php" matchType="IsFile" />
                    <action type="Rewrite" url="{R:0}.php" />
                <rule name="redirecting.php" enabled="false" stopProcessing="true">
                    <match url="^(.*).php$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{URL}" pattern="(.*).php$" />
                    <action type="Redirect" url="{R:1}" />

But they are not enough, i want to convert them to;

if possible;


if not;

product/id/5 will be enough.

ALSO, i need to exclude NTK folder from this rewrite engine.

People are also looking for solutions to the problem: php - How can i check if the paypal email can receive payments


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.