D
D
DenimTornado2013-03-02 21:12:03
Drupal
DenimTornado, 2013-03-02 21:12:03

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>

2. Add in the same place. There will be no code, already jammed.
<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>

3. I installed the Trailing Slash module, but it only partially adds and only for clean links.
Does anyone have similar experience?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MT, 2013-03-02
@DenimTornado

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>

A
asm0dey, 2013-03-03
@asm0dey

I beg you - well, does everyone know the rule about zhy / shy?

P
Plazik, 2013-03-06
@Plazik

Didn't the Global Redirect module help? His first step is put on a Drupal site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question