issue with URL rewrite?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: issue with URL rewrite?

Post by jmestep » Wed Jul 02, 2008 12:47 pm

I'm still working on this.
Logan, here is what I meant when I asked for the reverse of the code, but I wasn't too clear.
(I just spent an hour modifying categorygrid3.ascx for our display needs, then remembered that it won't pick up the order of the products in the admin- it starts out sorting by name.)
I need to either
1. Change categorygrid3.ascx to sort products the way they are in the admin. The patches on the forum now don't work on this display page. I think this is what controls the original display:
ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), SortResults.SelectedValue);


2. Fix categorygrid4.ascx to not show the C in the URLs, like the following code does.
//OUTPUT LINKED NAME
itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\">{1}</a><br />", catalogNodeUrl, catalogNode.Name)));

It would probably be a quick fix from Logan or sohaib.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

meer2005
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Feb 09, 2005 2:00 pm

Re: issue with URL rewrite?

Post by meer2005 » Wed Jul 02, 2008 2:44 pm

Yes, we use category4 and I think it was the only able issued page the included the C in the url.

Also, any feedback on what Judy mentioned above would be greatly appreciated
I did run across some code in a 5.5 store that came from 4.x where they had set up an .htaccess file for redirects. It starts out like:
# Helicon ISAPI_Rewrite configuration file
# Version 3.0.0.31

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: issue with URL rewrite?

Post by jmestep » Mon Jul 07, 2008 5:54 pm

I've finally come up with a fix in the CategoryGrid4.ascx. I put conditional code in to use in case the grid was displaying categories and added new code to display the ProductURL on the thumbnail and name if it is a product.

Code: Select all

 if ((itemTemplate1 != null) && (itemTemplate2 != null))
            {
                CatalogNode catalogNode = (CatalogNode)e.Item.DataItem;
                string catalogNodeUrl = this.Page.ResolveClientUrl(catalogNode.NavigateUrl);

                //jme 070808 get rid of c in product url
                if (catalogNode.CatalogNodeType == CatalogNodeType.Category)
                {
                    //OUTPUT LINKED THUMNAIL
                    if (!string.IsNullOrEmpty(catalogNode.ThumbnailUrl))
                    {
                        string thumbnail = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" border=\"0\" class=\"Thumbnail\" /></a><br />", catalogNodeUrl, ResolveUrl(catalogNode.ThumbnailUrl), catalogNode.ThumbnailAltText);
                        itemTemplate1.Controls.Add(new LiteralControl(thumbnail));
                    }

                    //OUTPUT LINKED NAME
                    itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\">{1}</a><br />", catalogNodeUrl, catalogNode.Name)));
                }
                //OUTPUT RETAIL PRICE IF AVAILABLE and URLs for Product without "C" in URL
                if (catalogNode.CatalogNodeType == CatalogNodeType.Product)
                {
                    Product product = (Product)catalogNode.ChildObject;
                    string productUrl = product.NavigateUrl;
                    productUrl = this.Page.ResolveClientUrl(productUrl);
                    if (!string.IsNullOrEmpty(product.ThumbnailUrl))
                    {
                        string thumbnail = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" border=\"0\" class=\"Thumbnail\" /></a><br />", productUrl, ResolveUrl(product.ThumbnailUrl), product.ThumbnailAltText);
                        itemTemplate1.Controls.Add(new LiteralControl(thumbnail));
                    }

                    //OUTPUT LINKED NAME
                   
                    itemTemplate1.Controls.Add(new LiteralControl(string.Format("<a href=\"{0}\" class=\"highlight\">{1}</a><br />", productUrl, product.Name)));

Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

sdlong02
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 95
Joined: Mon Jan 19, 2009 2:33 pm

Re: issue with URL rewrite?

Post by sdlong02 » Wed May 06, 2009 12:31 pm

Code worked great Judy

But since google has already indexed my site with the C in the URL it's still reporting it with a duplicate Title - will it consider this duplicate content?

Since the C part of the URL doesn't effect the page that loads, this means Google will continue to look at ~P#C#.aspx versus just ~P#.aspx and still load the page. How do you remove the extra URL's with the C if google already has them indexed and the page isn't 404'd? would a restriction on the bot suffice?

Is there a way to disable the URL from loading if it includes the C

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: issue with URL rewrite?

Post by jmestep » Wed May 06, 2009 1:48 pm

I just don't know. I think you can submit links to google to have them removed. There is also a new meta tag for canonical definition of links so that you can tell the search engine what one to use. I've see a little info on it, but haven't looked into it yet.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

sdlong02
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 95
Joined: Mon Jan 19, 2009 2:33 pm

Re: issue with URL rewrite?

Post by sdlong02 » Thu May 07, 2009 1:24 pm

Thanks for the tip Judy. I'll probably look at trying to get them removed from the google index since it should be a one time fix as the URL's are no longer mapped on the website.

I looked at the canonical meta tags and as far as i can tell they are static references to the "main" page and are placed in each of the duplicate pages. There's probably some sneaky way to code it into the backend to rewrite the link so it is pointing at the correct page, but with my limits it would require me to add the tag to each of my products.

The canonical meta tag may be useful for multiple category pages though, I haven't looked much at it, but I did see that google was marking duplicate titles for different pages of the same category. A canonical meta tag for these to point at the first page only may prove to be useful.

Post Reply