php - Seo Friendly URL with Rewrite

28

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:

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

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

if possible;

product/name/productname

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

Source

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.