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-Th eory-to-In crease-Inb ound-Resul ts.aspx.
becomes
/blog/tips/using-memory-th eory-to-in crease-inb ound-resul ts
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:
/blog/post/Using-Memory-Th
becomes
/blog/tips/using-memory-th
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}&page={R:2}" redirectType="Temporary" />
</rule>
To clarify, do all of the old urls include /blog/post and all the new ones are /blog/tips ?
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.
ASKER
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
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works.