Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 12-31-2009 14:02:56

Tanushiheadbash
Member
From: Stirling, Scotland
Registered: 07-20-2009
Posts: 82

HDSEO query- virtual directories

For those who use the HDSEO tool I created a numbe rof weeks back I have completed the latest version and it will be avaialble shortly- I will post separately when done.

However a question for those of you who understand how rewrite is implemented better than me.

I want to include an option to allow category entries to appear ina "virtual subdirectory"  called for example "category" or products to live in a virtual subdirectory called "products". The name is unimportant, just to allow the concept.
I have been prblems getting this to work though.
When I do it, the urls are rewritten but for some reason the page thats loaded is the master category page- the page layout which has all the main categories listed along with their representative thumbnails.

Any idea whats needed t make this work. I suspect its something to do with the catch all regex inthe .htaccess footer but not sure what addition would be needed to absorb my change
As an example here is an example of some rewritten urls with and without the virtual directory option. the one without works fine the other, while rewriting the url itself OK always loads the master category page. (PS I can change the virtual directory to "items" and it still does this- its not the text "category" at issue here! The example currently reads "item" as you can see below.
With virtual directory
RewriteRule ^ecom-catshow/cattrvapt\.html$ http://www.halleynet.com/testshopa/item … bles\.html [L,R=permanent]
RewriteRule  ^items/Adapters_and_Cables\.html$ ecom-catshow/cattrvapt\.html
A working url without virtual directory
RewriteRule ^ecom-catshow/catmobach\.html$ http://www.halleynet.com/testshopa/AC_M … gers\.html [L,R=permanent]
RewriteRule  ^AC_Mains_Chargers\.html$ ecom-catshow/catmobach\.html
#HDSEO end
RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]

and the corresponding HDSEO database entries:
id                                                                       name
/ecom-catshow/cattrvapt.html                     /items/Adapters_and_Cables.html
/ecom-catshow/catmobach.html               /AC_MAins_Chargers.html

Offline

 

#2 01-04-2010 15:50:47

jj1987
Member
From: Orlando, FL
Registered: 07-14-2008
Posts: 502
Website

Re: HDSEO query- virtual directories

I'm a bit confused as to what you want to do? The easiest way to do this would be to screw the HDSEO mod and just modify CORE_Display.php.  I read your post about your mod, but it seems like way too much work for something with very little SEO benefit, I'd much prefer an automated way to do things, which is what modifying the CORE_Display.php file gives you.

You can see an example here
HTML Page-
page--Page-Name--ref_string.html
Category Page-
cat--Category-Name--ref_string.html
Item Page-
item--Product-Name--ref_string.html

RewriteRule ^cat--(.*)--(.*)\.html index.php?app=ccp0&ns=catshow&ref=$2 [L,PT]
RewriteRule ^item--(.*)--(.*)\.html index.php?app=ccp0&ns=prodshow&ref=$2 [L,PT]
RewriteRule ^page--(.*)--(.*)\.html index.php?app=ccp0&ns=display&ref=$2 [L,PT]

That's for v6, but swapping to v7 is pretty clear from there.  Obviously if you want it to show up as subfolders, you'd do this-
RewriteRule ^cat/(.*)\.html index.php?app=ccp0&ns=catshow&ref=$2 [L,PT]

It sounds like you want to keep the item name in your URL, so you could do this (giving v7 code now)-
category/This-is-your-categorys-name--ref_string.html
RewriteRule ^category/(.*)--(.*)\.html index.php?app=ecom&ns=catshow&ref=$2 [L,PT]
Basically it's throwing away the $1 value (the name) since it's for SEO only and sending the only value the cart needs ($2).



Can you post an example of your ideal link structure?  If so, I think I can help you find a fast way to implement it.

Last edited by jj1987 (01-04-2010 15:59:07)



-James Garrett

Offline

 

#3 01-05-2010 16:33:33

Tanushiheadbash
Member
From: Stirling, Scotland
Registered: 07-20-2009
Posts: 82

Re: HDSEO query- virtual directories

Hi James
The tool I built was simply to work with HDSEO XMOD and make it suse easier for users. My own client was going to struggle withthe implementation of the syntax and the time and effort to use it so it was easy for me to script up something to automate the task in some generic way.
While I appreciate it may be possible to modify Core_Display to  do this inside vanilla SEO I really don't want to modify core files anymore than neccessary to facilitate future upgrades.
The tool I built is completely indepenedent of the shop and only accesses the database to make the htaccess file and to update the HDSEO table all automatically and seems to work quite well.
The feature I am trying to get working though is really just as I described:
First off as stated this works fine- here I create a file url called AC_Mains_Chargers.html which links to the SEO url ecom-catshow/catmobach.html
I can build this and the associated database links in my exisiting and new HDSEO update tool and it all works

Tanushiheadbash wrote:

A working url without virtual directory
RewriteRule ^ecom-catshow/catmobach\.html$ http://www.halleynet.com/testshopa/AC_M … gers\.html [L,R=permanent]
RewriteRule  ^AC_Mains_Chargers\.html$ ecom-catshow/catmobach\.html
#HDSEO end
RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]

and the corresponding HDSEO database entries:
id                                                                       name

/ecom-catshow/catmobach.html               /AC_MAins_Chargers.html

What I really want to have th eoption of doing (so this is to be an option not fixed is allow users if they like to spcify a directory name for products and categories and if they want cms items in the following format
I have referred to this as a virtual directory  as that what it looks like to the sit euser

With virtual directory
RewriteRule ^ecom-catshow/cattrvapt\.html$ http://www.halleynet.com/testshopa/item … bles\.html [L,R=permanent]
RewriteRule  ^items/Adapters_and_Cables\.html$ ecom-catshow/cattrvapt\.html
#HDSEO end
RewriteRule ^(.*)-(.*)/(.*)\.html index.php?app=$1&ns=$2&ref=$3 [L,PT]

id                                                                       name
/ecom-catshow/cattrvapt.html                     /items/Adapters_and_Cables.html

This syntax works in as much as the clicking on a link to the page above takes you to a page withthe correct url ie it says in this case http://halleynet.com/testshopa/items/Adapters_and Cables.html  but the page served is actually the master category pdisplay the page with all the main categories on. SO I guess there is a syntax issue in the rewriting here but I cannot work out what.  I though each ReWriteRule was independent but I notice things change whne you play round withthe catch all at the bottom. I though this was only to catch links that don't have a specific rule written for them.
Does this make sense now?

Offline

 

#4 09-02-2011 09:09:31

magwa
Member
Registered: 09-22-2007
Posts: 321

Re: HDSEO query- virtual directories

Did you ever solve this problem Tanushiheadbash?

Offline

 

Board footer