0

I'm new to this, but did try researching it. I can't find a suitable answer.

I am trying to rewrite some pages with the same names, but different directories to a single new page. For Example:

/dir1/oldpage.aspx

/dir2/oldpage.aspx

/dir1/dir2/oldpage.aspx

rewrite all locations of oldpage.aspx to /new/newpage.aspx

I tried this below, but it did not work. Any suggestions would be greatly appreciated

<system.webServer>
<rewrite>
    <rules>
        <rule name="SpecificRedirect" stopProcessing="true">
            <match url="^page$" />
            <action type="Redirect" url="/page.html" />
        </rule>
    </rules>
</rewrite>
</system.webServer>

1 Answer 1

1

your match pattern means something like yourdomain.org/page

you should try

 <match url=".*oldpage\.aspx" />

"^" - means that pattern must start with "page".

"$" - means that after page there is no any character

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.