Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: How i can make virtual directory Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
hetalpatel33
Groupie
Groupie


Joined: 19 November 2008
Location: United States
Online Status: Offline
Posts: 40
Posted: 25 February 2010 at 12:46pm | IP Logged Quote hetalpatel33

Hi

I am new to this. actually not but i am not able to understand url rewrite with regulare expression!

I have requirement of creating URL rewrite for the product listing & product detail Pages.

We have product categories , subcategories and their products. It has also the article pages.

I have made the url rewrite for the article pages by assing mannualy database field call parsename

RewriteCond Host:www.14gaam.com
RewriteRule /(.*)\.htm /parse.asp?ParseName=$1

www.14gaam.com/page.asp?page_Id=25 to

www.14gaam.com/about-us.htm 

The Products Catgories are

Main Category : Wedding-Cards
Sub Category  : 1)Hindu Wedding Cards
                      2)Muslim Wedding Cads
                      3)Christian Wedding Cads
                      4)Parsi Wedding Cads
                      5)Sikh Wedding Cads
                      6)Ishai Wedding Cads

I want the products pages for the category is http://www.14gaam.com/wedding-cards.htm

for products pages of Subcategory should be like this
http://www.14gaam.com/wedding-cards/hindu-wedding-cards.htm
http://www.14gaam.com/wedding-cards/muslim-wedding-cards.htm
http://www.14gaam.com/wedding-cards/christian-wedding-cards.htm
http://www.14gaam.com/wedding-cards/parsi-wedding-cards.htm
http://www.14gaam.com/wedding-cards/sikh-wedding-cards.htm
http://www.14gaam.com/wedding-cards/ishai-wedding-cards.htm

How i can make the top level category as virtual directory

Thanks alot for your help



__________________
Name it self is enough
Back to Top View hetalpatel33's Profile Search for other posts by hetalpatel33 Visit hetalpatel33's Homepage
 
hetalpatel33
Groupie
Groupie


Joined: 19 November 2008
Location: United States
Online Status: Offline
Posts: 40
Posted: 25 February 2010 at 12:47pm | IP Logged Quote hetalpatel33

I can remove the spaces between category & subcategory name!

__________________
Name it self is enough
Back to Top View hetalpatel33's Profile Search for other posts by hetalpatel33 Visit hetalpatel33's Homepage
 
hetalpatel33
Groupie
Groupie


Joined: 19 November 2008
Location: United States
Online Status: Offline
Posts: 40
Posted: 25 February 2010 at 12:49pm | IP Logged Quote hetalpatel33

Let me tell you that i have lite version 2.0

__________________
Name it self is enough
Back to Top View hetalpatel33's Profile Search for other posts by hetalpatel33 Visit hetalpatel33's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 26 February 2010 at 2:57am | IP Logged Quote Anton

Could you please give a little more explanation and some specific examples.
How do you address Category, Subcategory and Product pages now? What are their real URLs?

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
hetalpatel33
Groupie
Groupie


Joined: 19 November 2008
Location: United States
Online Status: Offline
Posts: 40
Posted: 26 February 2010 at 11:19am | IP Logged Quote hetalpatel33

Yes

Let me expalin in more details
I have lite versoin 2.0

I have article pages that has url rewrite as follows
When any page request from article.asp?page_id=1 I transfer them with asp 301 method to their parse name like
Requst Page: http://www.14gaam.com?page_id=1
Redirect Page : http://www.14gaam.com/about-us.htm
With Following Script

RewriteCond Host:14gaam.com
RewriteRule /(.*)\.htm /page.asp?ParseName=$1

Above rule work fine.!

Now we have Category Products in which products are listing.

Top Level Category : Wedding Cards (Category_Id = 1, Parent_Id =0)
Sub Level Category 1) : Hindu Wedding Cards (category_Id = 2, Parent_Id = 1)
Sub Level Category 1) : Muslim Wedding Cards (Category_Id = 3, Parent_Id = 1)
Sub Level Category 1) : Parsi Wedding Cards (Category_Id = 4, Parent_Id = 1)
Sub Level Category 1) : Christian Wedding Cards (Category_Id = 5, Parent_Id = 1)
Sub Level Category 1) : Ishai Wedding Cards (Category_Id = 6, Parent_Id = 1)

Currently we have pages like www.14gaam.com/categoryproducts.asp?category_id=1

Its list all the products of the top leven and sublevel categories

Now if we open subcategory like www.14gaam.com/categoryproducts.asp?category_id=2

It list only the products of Category "Hindu wedding cards".
for other subcategory same as above

Top Level Category URL (Wedding Cards)

Now Instead of www.14gaam.com/categoryproducts.asp?category_Id=1
I want like www.14gaam.com/wedding-cards

Sub Level Category URL (Hindu Wedding Cards)

Now Instead of www.14gaam.com/categoryproducts.asp?categoryId=2
I want like www.14gaam.com/wedding-cards/hindu-wedding-cards

Now for the products  detail i want something like this..

Currenly we have url like
www.14gaam.com/products.asp?product_id=25
I want the url like www.14gaam.com/hindu-wedding-cards/glossy-design.htm

Is there anyway we can do this with version 2.0 lite or version 3.0.

Thanks Anton for ur kind help.

Hetal Patel



__________________
Name it self is enough
Back to Top View hetalpatel33's Profile Search for other posts by hetalpatel33 Visit hetalpatel33's Homepage
 
hetalpatel33
Groupie
Groupie


Joined: 19 November 2008
Location: United States
Online Status: Offline
Posts: 40
Posted: 26 February 2010 at 11:21am | IP Logged Quote hetalpatel33

hetalpatel33 wrote:

Yes

Let me expalin in more details
I have lite versoin 2.0

I have article pages that has url rewrite as follows
When any page request from article.asp?page_id=1 I transfer them with asp 301 method to their parse name like
Requst Page: http://www.14gaam.com/page.asp?page_id=1
Redirect Page : http://www.14gaam.com/about-us.htm
With Following Script

RewriteCond Host:14gaam.com
RewriteRule /(.*)\.htm /page.asp?ParseName=$1

Above rule work fine.!

Now we have Category Products in which products are listing.

Top Level Category : Wedding Cards (Category_Id = 1, Parent_Id =0)
Sub Level Category 1) : Hindu Wedding Cards (category_Id = 2, Parent_Id = 1)
Sub Level Category 1) : Muslim Wedding Cards (Category_Id = 3, Parent_Id = 1)
Sub Level Category 1) : Parsi Wedding Cards (Category_Id = 4, Parent_Id = 1)
Sub Level Category 1) : Christian Wedding Cards (Category_Id = 5, Parent_Id = 1)
Sub Level Category 1) : Ishai Wedding Cards (Category_Id = 6, Parent_Id = 1)

Currently we have pages like www.14gaam.com/categoryproducts.asp?category_id=1

Its list all the products of the top leven and sublevel categories

Now if we open subcategory like www.14gaam.com/categoryproducts.asp?category_id=2

It list only the products of Category "Hindu wedding cards".
for other subcategory same as above

Top Level Category URL (Wedding Cards)

Now Instead of www.14gaam.com/categoryproducts.asp?category_Id=1
I want like www.14gaam.com/wedding-cards

Sub Level Category URL (Hindu Wedding Cards)

Now Instead of www.14gaam.com/categoryproducts.asp?categoryId=2
I want like www.14gaam.com/wedding-cards/hindu-wedding-cards

Now for the products  detail i want something like this..

Currenly we have url like
www.14gaam.com/products.asp?product_id=25
I want the url like www.14gaam.com/hindu-wedding-cards/glossy-design.htm

Is there anyway we can do this with version 2.0 lite or version 3.0.

Thanks Anton for ur kind help.

Hetal Patel



__________________
Name it self is enough
Back to Top View hetalpatel33's Profile Search for other posts by hetalpatel33 Visit hetalpatel33's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 01 March 2010 at 4:16am | IP Logged Quote Anton

Ok, thanks for the explanation. Yes, I guess it's possible to accomplish.
But, I would suggest using ISAPI_Rewrite 3 and mapfiles.
************************************
Here's the what the catmapfile.txt should look like:

1 wedding-cards
2 wedding-cards/hindu-wedding-cards

Here's the what the revcatmapfile.txt should look like:

wedding-cards 1
wedding-cards/hindu-wedding-cards 2

Here's the what the prodmapfile.txt should look like:

25 hindu-wedding-cards/glossy-design.htm

Here's the what the revprodmapfile.txt should look like:

hindu-wedding-cards/glossy-design.htm 25

******************************
Here's the config for v3 Lite:

RewriteMap catmapfile:catmapfile.txt [NC]
RewriteMap revcatmapfile:revcatmapfile.txt [NC]

RewriteMap catmapfile:catmapfile.txt [NC]
RewriteMap revcatmapfile:revcatmapfile.txt [NC]

RewriteCond %{HTTP_HOST} 14gaam\.com
RewriteRule ^/(.*)\.htm /page.asp?ParseName=$1 [NC,L]

RewriteCond %{QUERY_STRING} ^category_id=(\d+)$
RewriteCond ${catmapfile:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^categoryproducts\.asp$ /${catmapfile:%1}? [NC,R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${revcatmapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^/(.+/.+)$ /categoryproducts.asp?category_id=${revcatmapfile:$1} [NC,L]

RewriteCond %{QUERY_STRING} ^product_id=(\d+)$
RewriteCond ${prodmapfile:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^products\.asp$ /${prodmapfile:%1}? [NC,R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${revprodmapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^/(.+/.+\.htm)$ /products.asp?product_id=${revprodmapfile:$1} [NC,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
hetalpatel33
Groupie
Groupie


Joined: 19 November 2008
Location: United States
Online Status: Offline
Posts: 40
Posted: 03 March 2010 at 4:08pm | IP Logged Quote hetalpatel33

How & where i can make these three files
catmapfile.txt,revcatmapfile.txt  and revprodmapfile.txt files. The text in the files are hard coded? or it create automatically?



__________________
Name it self is enough
Back to Top View hetalpatel33's Profile Search for other posts by hetalpatel33 Visit hetalpatel33's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 04 March 2010 at 3:35am | IP Logged Quote Anton

These files should be located in the same directory with the above config.
You can either put the text into the files manually or use some script to write and update it.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum