0
votes

I have set up an SEO friendly url rewrite in IIS 6. It works on the url

mysite.com/horoscopes/weekly/46/virgo

Redirect rule: ^horoscopes/weekly\.aspx$

Rewrite Rule: ^horoscopes/weekly/([^/]+)/([^/]+)/?$

this translates to mysite.com/horoscopes/weekly.aspx?weeknum=46&starsign=virgo

How can I redirect this to

mysite.com/horoscopes/star-sign.aspx?pagetype=weekly-horoscope&star-sign=virgo

So this would be mysite.com/horoscopes/star-sign/virgo/weekly-horoscope/astrology (I'd force default to a type in this case)

I don't know whether to create a redirect or just change the original rule. Any ideas? Many thanks.

1

1 Answers

0
votes

My solution was to overwrite the weekly.aspx page with

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
    string StarSign = Request.QueryString["starsign"];

    Response.Status="301 Moved Permanently";
    Response.AddHeader("Location","http://www.mysite.com/horoscopes/star-sign/" + StarSign + "/weekly-horoscope/astrology");
}
</script>

This now redirects perfectly and lets google know it's a permanent move. Hope it helps someone else!