Forum Moderators: open
On our site, I want these urls:
[domain.com...]
to be a "virtual" URL (via ISAPI Rewrite):
[domain.com...]
I am using the product name in the url, but don't actually need it in the actual url.
I have come across several regular expressions, but heck if I know which one is right:
RewriteRule /(.*)\.htm /detail.asp\?product_id=$1
or
rewriteRule (.*)\.asp\?([^=].*)=(.*) $1/$2/$3.asp
What is important is that "detail.asp" be included into the regEx because we are using custom 404.asp pages and don't want to mess with that.
Welcome to WebmasterWorld [webmasterworld.com]!
Addressing only the regular-expressions issue (I can't tell you if your approach will work, since I'm in the Apache camp, where this would work):
This rule will find "fbwNNN.htm" in the Funky-Blue-Widget subdirectory, and rewrite it to /detail.asp\?product_id=fbwNNN, where fbwNNN is the product code (only).
RewriteRule ^/Funky-Blue-Widget/(.*)\.htm$ /detail.asp\?product_id=$1 [L]
This would work fine on Apache, but I'm not sure you need (or can have) the [L] flag, or even if this will work at all on non-Apache servers.
The basic approach is to have all your pages, including script-generated pages, refer to static-looking URLs. When a request for a static-looking URL in the Funky-Blue-Widget subdirectory comes back from the user's browser, it is converted to the proper format needed to call your script. Since all URLs which are visible to the outside world are "friendly" URLs, that's what the search engines will index.
HTH,
Jim
Thanks. That is on the right track. "Funky Blue Widget" isn't a true subdirectory, it's actually the product name. So in more generic terms the links would be:
[domain.com...]
the "real" url would be
[domain.com...]
Thanks.