Answer the question
In order to leave comments, you need to log in
Drupal on IIS7 how to defeat slashes in URL?
Hello!
By the will of fate, we have to support the site on Drupal 7 on IIS 7.5, Win Server 2008. The bottom line is that the SEOs received a task, it is necessary that the links were either all with a slash, or all without. Neither of these things I can do.
What I tried:
1. Remove via web.config
<rule name="Remove trailing slash" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>
<rule name="Redirect to Trailing Slashes" stopProcessing="true">
<match url="^(.*(?:^|/)[^/\.]+)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_METHOD}" pattern="post" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/" />
</rule>
Answer the question
In order to leave comments, you need to log in
Try this (this rule adds a trailing slash if it's missing):
<rule name="Add trailing slash" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/" redirectType="Permanent" />
</rule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question