LittleFunny
LittleFunny

Reputation: 8405

URL Rewrite: Is my syntax of the rule wrong

Hello i am using a Smartasp which i allowed me to do url rewrite. I placed a rules on web.config like this:

<system.webServer>
        <rewrite>
            <rules>
                <rule name="AmazonS3" stopProcessing="true">
                    <match url="http://www.blah/amazon/(.*)" />
                    <action type="Redirect" url="http://amazon.blah/{R:1}" logRewrittenUrl="true" redirectType="Permanent" />
                </rule>
                <rule name="AmazonS3 with port" stopProcessing="true">
                    <match url="http://www.blah.com:80/amazon/(.*)" />
                    <action type="Redirect" url="http://amazon.blah.com/{R:1}" logRewrittenUrl="true" redirectType="Permanent"/>
                </rule>

Where i try to read the requested url : www.blah.com/amazon/ to amazon.blah.com. After typing the www.blah.com/amazon/ the browser didn't redirect to amazon page...

On my local machine where i typed the rules has a rewrite tag highlighted saying invalid rewrite under system.webserver. Am i missing something?

Upvotes: 0

Views: 49

Answers (1)

Ali
Ali

Reputation: 2592

Try it this way with a http:

<rule name="Page Redirect" stopProcessing="true">
  <match url="www.blah.com/amazon/"/>
  <action type="Redirect" url="http://amazon.blah.com" redirectType="Permanent"/>
</rule>

Upvotes: 1

Related Questions