You are here:  » Capital letters in URL


Capital letters in URL

Submitted by JasonG on Fri, 2013-05-10 14:39 in

When I created my products and mapped them I used capitals i.e. James Wellbeloved Adult Lamb and Rice 15Kg

I still want this on the page and as the H1 which we have now

But I want lower case in my URL, can this be done?

Thanks
Stuart

Submitted by support on Fri, 2013-05-10 15:27

Hi Stuart,

Sure - you can make the change in a single location - in includes/tapestry.php look for the following code at line 53:

return $config_baseHREF."product/".urlencode(tapestry_hyphenate($product["normalised_name"])).".html";

...and REPLACE with:

return $config_baseHREF."product/".urlencode(tapestry_hyphenate(strtolower($product["normalised_name"]))).".html";

Cheers,
David.
--
PriceTapestry.com

Submitted by 2fer on Sun, 2013-08-25 01:43

Hi David,
I have been wrestling with this problem, so I must be doing something wrong. I first tried using this edit in tapestry.php and it does give me lower case URLs, but titles, (uses titles) and descriptions are all lower case also and I don't want that.

I tried using the lowercasepatch.zip, but it does the same thing. I am going to go back to original versions of tapestry.php, reviews.php and products.php and came here to ask if there is an edit that will only change the URLs. If not, I will learn to get along with upper case URLs.
Thank you

Submitted by support on Sun, 2013-08-25 11:52

Hi,

I did just double check the patch that I sent to you on my test server, but perhaps if you'd like to try the changes one step at a time; first of all, in includes/tapestry.php look for the following code at line 69:

  return $config_baseHREF."product/".urlencode(tapestry_hyphenate($product["normalised_name"])).".html";

...and REPLACE with:

  return $config_baseHREF."product/".urlencode(tapestry_hyphenate(strtolower($product["normalised_name"]))).".html";

And then in products.php, let's concentrate on the title first (browser title bar, so <title> title tag in the head) in products.php look for the following code, also at line 69:

  $header["title"] = $q;

...and REPLACE with:

  $header["title"] = $product["products"][0]["name"];

If all good, let me know and i'll post the final changes for description...

Cheers,
David.
--
PriceTapestry.com

Submitted by 2fer on Sun, 2013-08-25 16:44

Hi David,
I don't know if my previous problems were due to cache, because I repeated the same uploading today, after verifying the lines shown above, (which were as shown here) and it is definitely doing what it is supposed to do for the product pages now. Thank you!