I'm gonna add my site to "show off" once it's done... It's hugely modified from the nopCommerce default, so will be purchasing a license as it goes online :)
This rewriter works only with .aspx extensions, and you have .htm extension. If you use IIS 7 (and integrated pipeline) then maybe you can make it work by adding to web.config
I get an ASP 404 error page listing the requested page as Requested URL: /qrijqoirhjwqorj/default.aspx
(even though I requested qrijqoirhjwqorj and not qrijqoirhjwqorj/)
Anyway here's the interesting bit... When I request my .htm which I added to my URL re-writer config file..
Requested URL: /Products/myproduct.aspx
it DOES actually say it's reqeusting the CORRECT URL as per my config file... however, it still throws a 404..
I am assuming the URL re-writer has done it's job... but then the URL it's tried to send doesn't exist because it's trying to re-write to a re-write...
This is about to get a whole lot more complicated I think but if I can crack it I'll be happy! I want to make this an interesting and useful thread for others too!
OK...
If you set ALL requests to go through the URL handler then type in something which doesn't exist; eg/ www.mysite.com/rwqqwerwer
you get a 404 returned for www.mysite.com/rwqqwerwer/default.aspx
When you visit the homepage you also get www.mysite.com/default.aspx in the address bar
So what I did was... I set it back to default... then in IIS I added a managed handler for *.htm, *.html requests which uses the URL re-writer... So now if you type something which doesn't exist you get a proper 404 response.
Also if you type in a .htm request which is in the URL re-writing config file, it works!
The only problem I have now is this... if you type something which doesn't exist that has a .htm or .htm extension..
eg/ www.mysite.com/rewerewerw.htm
I get an ASP error page saying "UrlRewriter does not implement IHttpHandlerFactory or IHttpHandler."
Basically, if the URL re-writing module doesn't have a rule so it throws an error...
Is there a way I can re-configure it so that EVERYTHING which doesn't exist that goes through the URL handler goes to my 404 page?
This would be awesome :) As my 404 page is an ASP file with a 301 handler map...
The idea behind all this is basically... the TOP requested pages from the old site get re-written so they still appear to exist.. and everything else goes to the 404 page which then 301's them to a new relavant location.... if nothing is found in the 301 handler then it FINALLY displays a 404 page.
I know it's a pain but SEO is paramount to this site!! This way 404 pages will rarely be seen unless something doesn't exist on the current site, OR the old site.