Finally Stating Up on This Cool Product

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 6
Joined: 26 Jun 2014, 09:15

Finally Stating Up on This Cool Product

26 Jun 2014, 09:27

I am just using the samples found in the .CHM help file, and am starting to get things to work, but would like to know how to build deeper paths into our directory structure than the examples, which start at
the root folder.

http://www.edenusa.com/products/our_super_tool.asp

So using the provided example for SEO driven URL re-writing, I must install the three necessary files into the ROOT of website (not a good idea), as the rule is written that way somehow.

Try to hit the URL above, and it should say "Hello World." But unknown to the user, the "products" directory doesn't actually exist and everything making this work is tied up in the regular expressions code (which I am learning).

Therefore, my question is, I would much rather have at leat 1 folder deeper than the root, called, "Products" or "Services", and then every file necessary to build a nice product card could be in that one folder, but even that is going to get messy.

So, ideally, you would have a directory structure more like this:

PRODUCTS
- Bicycles
- Go Gars
- Motorcycles

Please let me know how this can be done, and I'll give it a go when I get your answer back. Much appreciated!

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Finally Stating Up on This Cool Product

27 Jun 2014, 09:27

Hello,

Thanks for your detailed explanation. However, it would be really nice if you provided us with some specific examples of how you want things to work.
What rules are you trying to make working?
Where should the URL you provided actually point?

User avatar
Posts: 6
Joined: 26 Jun 2014, 09:15

Re: Finally Stating Up on This Cool Product

28 Jun 2014, 20:57

Hello Anton,

This is actually quite simple. Your example code under the HELP file provided with the product, is all designed to work ONLY FROM THE ROOT DIRECTORY.

Here is the code in your example:

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.104

RewriteEngine on
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^products/([^?/]+)\.asp /productpage.asp?productID=${mapfile:$1}

I want to be able to make this work under common directory structures, not just from the ROOT folder. That would result in a huge mess eventually.

So the RewriteRule needs to be something like this, I am assuming (but it doesn't work when I try it):

RewriteRule ^rental_catalog/products/([^?/]+)\.asp /productpage.asp?productID=${mapfile:$1}


Unfortunately, this does not work!

So how would I configure the RewriteRule so that I can use any type of directory structure that I would like to?

I sincerely hope that this is more clear than my first inquiry. Thank you so much!

User avatar
Posts: 92
Joined: 01 Dec 2012, 14:22

Re: Finally Stating Up on This Cool Product

29 Jun 2014, 07:25

I think it would clarify matters if you would post perhaps half-a-dozen examples of what you want the URL to look like, and what you want the actual file served to be (with parameters).

E.g.

http://www.edenusa.com/products/our_super_tool.asp -> products.asp?id=super_tool

I'm not sure what your point is about folders; there's no requirement for /products to exist for this to be a valid rewriteable URL.

Rewrite doesn't only work from the root; it's just that's the default start point.

If all the URLs you want to rewrite start with /products, you can use the RewriteBase to set that.

I have a site where URLs that start with /search are rewritten to a /search.asp?param=$1, so that people can "save" simple searches. If we ever need to change the way the search works, slipping a new rule in there will mean that their bookmarks will continue to work.

User avatar
Posts: 6
Joined: 26 Jun 2014, 09:15

Re: Finally Stating Up on This Cool Product

29 Jun 2014, 14:33

I am not sure why nobody thus far gets this. I try using the same code ANYWHERE EXCEPT FROM THE ROOT, and it does not work. It's that simple.

User avatar
Posts: 6
Joined: 26 Jun 2014, 09:15

Re: Finally Stating Up on This Cool Product

29 Jun 2014, 21:21

I really need to get this going. Should I forget about using ISAPI_REWRITE and purchase the LINKFREEZE product instead?

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Finally Stating Up on This Cool Product

30 Jun 2014, 05:59

Hello,

So, you say that the following rule

RewriteRule ^rental_catalog/products/([^?/]+)\.asp /productpage.asp?productID=${mapfile:$1}

doesn't work when you request something like www.domain.com/rental_catalog/products/product.asp?
- What result do you get upon this request?
- Do you have a mapfile with pairs of values one of which should be used is the right part of the rule?
- Can you give at least one example of what the request should be and where it should actually point?

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 9 guests