Link to home
Start Free TrialLog in
Avatar of GoodCode
GoodCode

asked on

301 strip aspx from URL in IIS

We changed our blog and now the url's don't have .aspx on the end of them but the URL is still the same otherwise. So

/blog/post/Using-Memory-Theory-to-Increase-Inbound-Results.aspx.

becomes

/blog/tips/using-memory-theory-to-increase-inbound-results

I'd like to 301 all of the old url's to the new link.

This is the rule I tried but it' redirects to the 404 page:

  <rule name="Rewrite old blog to PHP format (compound route)" stopProcessing="false">
          <match url="([^/]+)/([^/\?]+)\.aspx$" />
          <action type="Rewrite" url="index.php?route={R:1}&amp;page={R:2}" redirectType="Temporary" />
        </rule>

Open in new window

Avatar of sykesjs
sykesjs
Flag of United States of America image

To clarify, do all of the old urls include /blog/post and all the new ones are /blog/tips ?
Avatar of GoodCode
GoodCode

ASKER

Oh good catch I didn't even notice that. All of the old url's are blog/post and the new urls are blog/category  but the biggest category is tips so I can just have blog/tips be the default.
I apologize just tested it and it works even if you put post instead of the category.
try to use the built in url mapping in the iis
How would I do that? I'm in the rewrite map section but I'm not sure what to put for the original value and new value.
ASKER CERTIFIED SOLUTION
Avatar of GoodCode
GoodCode

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It works.