httpurlurl-rewritingtuckey-urlrewrite-filter

How can I redirect from one url to another using Tuckey URL rewriting?


I've two domain names e.g. www.1st-domain.com and www.2nd-domain.com I want to write a Tuckey URL Rewrite rule to redirect any request that goes to www.1st-domain.com to www.2nd-domain.com

E.g. if someone hits www.1st-domain.com/sample it should be redirected to www.2nd-domain.com/sample

I'm trying something like:

<rule>
        <name>Domain Name Check</name>
        <condition name="host" operator="equal">www.1st-domain.com</condition>
        <from>^(.*)</from>
        <to type="redirect">http://www.2nd-domain.com$1</to>
    </rule>

It is not working. What am I doing wrong? Please guide.


Solution

  • I'm happy to admit that I made a mistake & the redirection actually works:

    <rule>
            <name>Domain Name Check</name>
            <condition name="host" operator="equal">www.1st-domain.com</condition>
            <from>^(.*)</from>
            <to type="redirect">http://www.2nd-domain.com$1</to>
        </rule>