In server we are using Internet Information Services (IIS) with PHP, PHP Manager. I want to hide "dava" parameter, not only for /kovusturma-sartlari/onodeme/ page, in whole website "dava" key should hide and should be page/value.
Current URL: http://localhost/kovusturma-sartlari/onodeme?dava=f2b80bf7
Expected URL: http://localhost/kovusturma-sartlari/onodeme/f2b80bf7
My Currently Rules:
<rewrite>
<rules>
<rule name="Add .php extension" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}.php" matchType="IsFile" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_URI}" pattern="^/home" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.php" />
</rule>
<rule name="Rewrite to /home" stopProcessing="true">
<match url="^(.*[^\]+)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/home/{R:1}.php" />
</rule>
</rules>
</rewrite>
I Tried:
<rule name="Hide Query String" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{QUERY_STRING}" pattern="dava=(.+)" />
</conditions>
<action type="Rewrite" url="{R:0}/{C:1}" appendQueryString="false" />
</rule>
2
Answers
Maybe try this?
You can refer to this article, the examples in the article will help you understand how to create the correct rewrite rules.
If you want to hide the "dava" parameter for /kovusturma-sartlari/onodeme/ page, you can try the following rule:
If the "dava" key needs to be hidden in the entire website, you need to modify the rule according to the specific situation of your website,like:
Also, when you have problems with IIS rewrite rules, you can try using Failed Request Tracing to trace rewrite rules for troubleshooting, and you can see how the rules are used internally.