How to Capitalize URL - Easy Eye Hook

Hello,



This capitalized URL:



[url]http://mysite.com/Adidas-Mens-Climacool-Mesh-Polos.html[/url]



Is easier to read than this non-capitalized URL:



[url]http://mysite.com/adidas-mens-climacool-mesh-polos.html[/url]



This is particularly true in the SERP, where the capitalization of URLs becomes a hook to the eye of the reader.


[QUOTE]Initial capitalization produces a lift of between 10% and a whopping 50%. Why? The eye naturally gravitates toward capitalization.[/QUOTE]



Source: [url]http://www.blindfiveyearold.com/ppc-display-url-initial-capitalization[/url]



Edit this file:



/addons/seo/[COLOR=“Blue”]func.php[/COLOR]



Change this code:


}<br />
		$seo_name = $seo_name . '.html';<br />
		unset($query_params['product_id']);
```<br />
<br />
With this code:<br />
<br />
```php
}<br />
		$seo_name = preg_replace('!((?:\b|-).)!e', 'strtoupper("$1");', $seo_name);<br />
		$seo_name = $seo_name . '.html';<br />
		unset($query_params['product_id']);
```<br />
<br />
That's all folks!<br />
<br />
<br />
<br />
Lee Li Pop

Good let me try. Do you also know how to make short links?

is this for 2.0 or can use for 1.3.5 and will Apache allow to do this

[quote name=‘miracles’]Good let me try. Do you also know how to make short links?[/quote]



Short links? Sorry, I don’t understand what you mean…



Could you give us an example of non-short link Vs. same URL in short link format?


[quote name=‘flasher’]is this for 2.0 or can use for 1.3.5 and will Apache allow to do this[/quote]



Yes, this is working for CSC 2.0 and for CSC 1.3.5.





Lee Li Pop

Long link



www.domain.com/shop/category/product.html



Short link



www.domain.com/shop/product.html



Did you understand now ?

[quote name=‘miracles’]Do you also know how to make short links?[/quote]




[quote name=‘miracles’]Long link



www.domain.com/shop/category/product.html



Short link



www.domain.com/shop/product.html

[/quote]



Well, it’s in backoffice:



Administration > Addons > SEO (requires Apache + mod_rewrite installed) > edit



But, you need to active “SEO (requires Apache + mod_rewrite installed)” addon before.





Lee Li Pop

Is there a way to capitalize the product name when import from csv file? This is because some of my suppliers use upper case for the product name in their csv file and this looks ugly.

Hello Rommy,


[quote name=‘rommy’]Is there a way to capitalize the product name when import from csv file? This is because some of my suppliers use upper case for the product name in their csv file and this looks ugly.[/quote]



You can easily change upper case in csv file.



To do it, you can use Calc a free spreadsheet software from Sun, editor of OpenOffice:



[URL]http://download.openoffice.org/index.html[/URL]





Lee Li Pop

[quote name=‘Lee Li Pop’]Hello Rommy,







You can easily change upper case in csv file.



To do it, you can use Calc a free spreadsheet software from Sun, editor of OpenOffice:



[URL]http://download.openoffice.org/index.html[/URL]





Lee Li Pop[/QUOTE]



Thanks for your response. I am using Open Office at the moment but I don’t know how to change the upper case in csv file. Could you please show me what to do? I am such a n00b at this.



Thanks in advance.



rommy

[quote name=‘rommy’]Thanks for your response. I am using Open Office at the moment but I don’t know how to change the upper case in csv file. Could you please show me what to do? I am such a n00b at this.



Thanks in advance.



rommy[/quote]



Try this:



[URL]http://www.oooforum.org/forum/viewtopic.phtml?t=72963&view=previous[/URL]





Lee Li Pop

Nice tip Lee Li!



I just wanted to add that this needs to be placed elsewhere as well if you want your categories, pages, and forms to reflect the capitalization. This is for 1.3.5 (2.0.x is on the backburner until further notice) and the changes are in [COLOR=“Blue”]blue[/COLOR]. I haven’t looked at 2.0.x but it should be along the same lines.


// P R O D U C T
if ($object_type == 'p') {
// Categories path
if ($seo_types['seo_product_type'] == 'category') {
$cat_path = db_get_field("SELECT b.id_path FROM $db_tables[products_categories] as a LEFT JOIN $db_tables[categories] as b ON a.category_id=b.category_id WHERE a.product_id='$object_id' AND a.link_type='M'");
if (!empty($cat_path)) {
$cats = explode("/", $cat_path);
foreach ($cats as $v) {
$item_names[] = fn_get_seo_name($v, 'c');
}
}
}
[COLOR="Blue"]$seo_name = preg_replace('!((?:\b|-).)!e', 'strtoupper("$1");', $seo_name);[/COLOR]
$seo_name = $seo_name .'.html';

// C A T E G O R Y & T O P I C
} elseif (strpos(' ct', $object_type)) {
if ($object_type == 'c') {
$_path = db_get_field("SELECT id_path FROM $db_tables[categories] WHERE category_id='$object_id'");
} elseif ($object_type == 't') {
$_path = db_get_field("SELECT id_path FROM $db_tables[topics] WHERE topic_id='$object_id'");
}
if (!empty($_path)) {
$_path_i = explode("/", $_path);
array_pop($_path_i);
foreach ($_path_i as $v) {
$item_names[] = fn_get_seo_name($v, $object_type);
}
}
if ($seo_types['seo_category_type'] == 'file') {
// Add sortings
if (!empty($suffix['sort_by']) && !empty($suffix['sort_order'])) {
$_suffix = '?sort_by='.$suffix['sort_by'].'&sort_order='.$suffix['sort_order'];
}
// Add pagination
if (!empty($suffix['page']) && $suffix['page'] != '1') {
$seo_name .= $d.'page'.$d.$suffix['page'];
}
[COLOR="Red"]$seo_name = preg_replace('!((?:\b|-).)!e', 'strtoupper("$1");', $seo_name);[/COLOR]
$seo_name = $seo_name .'.html';
} else {
// Add sortings
if (!empty($suffix['sort_by']) && !empty($suffix['sort_order'])) {
$_suffix = '?sort_by='.$suffix['sort_by'].'&sort_order='.$suffix['sort_order'];
}
// Add pagination
if (!empty($suffix['page']) && $suffix['page'] != '1') {
$seo_name .= '/'.'page'.$d.$suffix['page'];
}
[COLOR="Red"]$seo_name = preg_replace('!((?:\b|-).)!e', 'strtoupper("$1");', $seo_name);[/COLOR]
$seo_name = $seo_name . '/';
}

// P A G E S
} elseif ($object_type == 'a') {
$top_path = db_get_field("SELECT id_path FROM $db_tables[topics] as a LEFT JOIN $db_tables[pages_topics] as b ON a.topic_id=b.topic_id LEFT JOIN $db_tables[pages] as c ON c.page_id=b.page_id WHERE c.page_inner_id='$object_id'");
if (!empty($top_path)) {
$topics = explode("/", $top_path);
foreach ($topics as $v) {
$item_names[] = fn_get_seo_name($v, 't');
}
}
[COLOR="Blue"]$seo_name = preg_replace('!((?:\b|-).)!e', 'strtoupper("$1");', $seo_name);[/COLOR]
$seo_name .= (($seo_types['seo_category_type'] == 'file') ? '.html' : '/');

// F O R M S
} elseif ($object_type == 'f') {
if (!empty($suffix['mode'])) {
$_suffix = "?$mode_name=sent";
}
[COLOR="Blue"]$seo_name = preg_replace('!((?:\b|-).)!e', 'strtoupper("$1");', $seo_name);[/COLOR]
$seo_name .= (($seo_types['seo_category_type'] == 'file') ? '.html' : '/');
}






EDIT: [COLOR=“Red”]This[/COLOR] didn’t work so well. Even though it capitalized the name, it was interfering with the pagination returning a 404.

Anyone have any luck with this for categories and/or pages? Would be nice as my results rely more on these than the product names.

cool Tweak.

Hello Vikram,



Thanks to you to read and follow my tips and tricks!





Lee Li Pop

More complicated than it needs to be and you lose control over your capitalize letters.



Do what I do. My SEO link are caps where it needs to be cap.



For example:



[url]Printer inkjet cartridges and laser toners for cheap | inkWOW.com



or



[url]Printer inkjet cartridges and laser toners for cheap | inkWOW.com





Requires only one simple modification.





Modify the function ‘fn_generate_name’ in the file ‘core/fn.catalog.php’



Comment out the strtolower() function like this:





```php #$str = strtolower($str); // only lower letters

```

[quote name=‘hyteckit’]Modify the function ‘fn_generate_name’ in the file ‘core/fn.catalog.php’



Comment out the strtolower() function like this:





```php #$str = strtolower($str); // only lower letters

```[/quote]



Hello hyteckit,







I tried on your website:



[URL]Printer inkjet cartridges and laser toners for cheap | inkWOW.com



Incredible! Works even in Categories!



You’re definitively better than me



(OK, I know, it’s easy :mrgreen: )



Do you have the same solution for CSC 1.3.5?



Thanks for sharing,





Lee Li Pop

Ok…I’m a total idiot when it comes to coding but I thought this would be pretty straightforward. I found the file and line of code but what I have tried doesn’t seem to work. Can this be explained in more simple instructions (if possible)? Forgive my ignorance but a “replace this with THIS” would help out a newb like me.

Hello IsItFast,



Yes, I tried to change this file on CSC 2.0.x:



/core/[COLOR=blue]fn.catalog.php[/COLOR]



Without any success. It doesn’t work for me :frowning:



It would be a nice idea if hyteckit could explain us his tweak…





Lee Li Pop

If you already had SEO enabled before then you will need to run a query on the cscart_seo_names table to delete the existing seo names