R
R
Roman2015-02-11 18:00:50
Angular
Roman, 2015-02-11 18:00:50

How to set up a redirect in IIS?

Hello!
By the will of fate, our site is hosted on IIS
At the front, we have angular. To make it friends with SEO, you need to do a few magic steps.
Yandex recommendations on this matter:


For example, if a page is available at www.example.com/blog and contains the meta tag , then the robot will index the HTML version of the page at www.example.com/blog?_escaped_fragment_= .

In my project, snapshots of html pages are stored in the snapshots folder.
You need to configure IIS so that when you receive a request like this
localhost:8002/cases/aug?_escaped_fragment_=

a redirect to the corresponding url was performed
localhost:8002/snapshots/cases/aug.html

I installed mod rewrite on IIS
and configured the following config:
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^.*$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" pattern="" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" pattern="" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^.*$" />
                    <action type="Rewrite" url="index.html" />
                </rule>
                <rule name="Snapshots" stopProcessing="true">
                    <match url=".*localhost\:8002\/(.*)\?_escaped_fragment_=" ignoreCase="true" />
                    <action type="Redirect" url="http://localhost:8002/snapshots/{R:1}.html" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

But I don't understand where I'm wrong. Redirect doesn't work! Tell me pliz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Zon, 2015-02-12
@zonevgeniy

Why is 301 through .htaccess bad?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question