Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * - 2 votes

[Contribution] Ultimate SEO URLs - by Chemo


1938 replies to this topic

#21 100asa

  • Community Member
  • 390 posts
  • Real Name:Remigio
  • Location:Italy

Posted 18 January 2005, 09:09

I've understand the modify of Webpixie. I've just addedd, but I don't see the manufactures name.
Skype: centoasa
Skype: remigioruberto

#22 Bean Boy

  • Community Member
  • 9 posts
  • Real Name:N B

Posted 18 January 2005, 11:59

Chemo, on Jan 17 2005, 09:01 PM, said:

You need to run the install script and then configure it from the newly installed admin control panel settings!  Notice how SEO_URLS_CACHE_DIR is not being converted to its cooresponding value?  That's because most likely it is not defined...which means it's not installed. 

Run the install script, then configure.  Make sure it is the FULL filesystem path beginning with a forward slash and ending with a slash!!

Make sure that you performed the step that adds code to the .htaccess file! 

Bobby

<{POST_SNAPBACK}>


I have checked that I have the full filepath to the catalog folder instead of the stock /folder/ in .htaccess, and that the .htaccess file is residing in the catalog directory, but still no joy? Hmmm. Any more ideas would be much appreciated

regards

#23 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 18 January 2005, 13:44

clarocque, on Jan 18 2005, 03:22 AM, said:

Anyone have any luck resolving this issue?

Chris

<{POST_SNAPBACK}>

It's not really an issue since it takes you to the same product. This may confuse customers but the root cause is linked products and not duplicate products.

pauldarthvader, on Jan 18 2005, 03:51 AM, said:

Warning: main(): Failed opening 'home/iimdfjwt/cache/seo_english.cache'
...

<{POST_SNAPBACK}>

Your path needs to start with a leading slash like this:
/home/iimdfjwt/cache/seo_english.cache

Otherwise it is interpreted as a relative path...it should be absolute!

Bobby

#24 pauldarthvader

  • Community Member
  • 80 posts
  • Real Name:Paul Spiers
  • Location:UK

Posted 18 January 2005, 14:59

Chemo, on Jan 18 2005, 01:44 PM, said:

It's not really an issue since it takes you to the same product.  This may confuse customers but the root cause is linked products and not duplicate products. 

Your path needs to start with a leading slash like this:
/home/iimdfjwt/cache/seo_english.cache

Otherwise it is interpreted as a relative path...it should be absolute!

Bobby

<{POST_SNAPBACK}>


Hi

Thanks bobby, that seems to have done the trick.
And now i see it working, GREAT CONTRIBUTION, HIGHLY RECOMEND!

See it working here Gadgets UK
Paul
Regards
Paul

#25 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 18 January 2005, 15:02

It's amazing what it'll do when configured correctly :)

Try turnng on the rewrite option and then clear all your cache files...it gets even better! :)

Bobby

#26 apexdog

  • Community Member
  • 15 posts
  • Real Name:Dan

Posted 18 January 2005, 15:05

Hi.

I just installed Ultimate SEO URLs. Its the best contribution that I have installed & the documentation is excellent.

But, I have a small problem. Results returned by the advanced search function are not rewritten, breadcrumbs links on product pages arrived at through the advanced search results also not rewritten.

You can try it here: www.apexdog.com

Server info (Apache on *NIX machine, etc)
Linux 2.4.21-27.0.1.ELsmp
MySQL 4.0.22-standard
4.3.10 (Zend: 1.3.0)
Apache 1.3.33

Exact problem
Described above

What you've tried to solve it
Make this post

...and any debuggin you've done
None, don't know where to start

#27 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 18 January 2005, 15:17

Dan,

It can be fixed but adds a layer of complexity to the contribution. See, other SEO URL contributions try to rewrite EVERYTHING for the store. I took a simple approach and only selected the URLs for index.php (categories) and product_info.php (products).

IMO, SEO URLs are for search engines / spiders as priority #1. They are also nice for customers for easy to remember addresses but that is an arguable point as to whether they will use them to come back (versus hitting you main domain and working back through).

So, my contribution only optimizes the URLs that are absolutely essential for search engines (categories and products) and leaves the rest to the customer. You will NOT have a spider go to the advanced search page, enter search criteria, and then hit the submit button. Only customers will do that...

I can add the advanced_search.php URL's to the list of optimized URLs but overall it will make the contribution harder to install (READ: MORE STEPS) and more complex. A general rule is that the more moving parts on something the more places available to break down. I would rather have something that works for its intended purpose without being too bloated, slow, or complex.

As it is coded now the functionality is excellent, the ease of install is allows installation by all level of webmasters/store owners, and also is *almost* bullet proof with stability.

Bobby

#28 Fourbit

  • Community Member
  • 96 posts
  • Real Name:Paul
  • Location:Montanan

Posted 18 January 2005, 15:34

Bean Boy, on Jan 18 2005, 04:59 AM, said:

I have checked that I have the full filepath to the catalog folder instead of the stock /folder/ in .htaccess, and that the .htaccess file is residing in the catalog directory, but still no joy? Hmmm. Any more ideas would be much appreciated

regards

<{POST_SNAPBACK}>


Sorry, I may have confused you on this.
RE: .htaccess file

# Change "folder" to your catalog directory name
RewriteBase /folder/

change that to just
# Change "folder" to your catalog directory name
RewriteBase /catalog/

Don't put the full path there.

Bobby is saying to use the "full path" in the Admin Configuration screen for the SEO URL's.

Paul

Edited by Fourbit, 18 January 2005, 15:36.


#29 adauktion

  • Community Member
  • 30 posts
  • Real Name:Michi

Posted 18 January 2005, 15:46

hello,

i have a little prob with this contrib.

i can´t set
Use search-engine urls
to false (second shop, same database)

if i dont set the Use search-engine url to false, i dont get products in my shopping cart

message:
the requested url was not found

thx for your help
mike

#30 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 18 January 2005, 15:57

On the store that you need to disable SEF URLs place this code at the very top of includes/application_top.php:
define('SEARCH_ENGINE_FRIENDLY_URLS', 'false');
The thing to remember is that something can only be defined once. So, when the configuration for that store is pulled and it tries to define it as true it will be disregarded as it is already defined (can't change a defined value).

That will turn off SEF URLs for the shop and leave the other store with the value true.

Bobby

#31 adauktion

  • Community Member
  • 30 posts
  • Real Name:Michi

Posted 18 January 2005, 16:44

hello bobby,

very simple idea - i think to complicated - many thx

#32 Bean Boy

  • Community Member
  • 9 posts
  • Real Name:N B

Posted 18 January 2005, 17:17

Fourbit, on Jan 18 2005, 04:34 PM, said:

Sorry, I may have confused you on this.
RE: .htaccess file

# Change "folder" to your catalog directory name
RewriteBase /folder/

change that to just
# Change "folder" to your catalog directory name
RewriteBase /catalog/

Don't put the full path there. 

Bobby is saying to use the "full path" in the Admin Configuration screen for the SEO URL's.

Paul

<{POST_SNAPBACK}>


hi, this is how the addition to .htaccess in catalog now looks. This has not made any difference to the problem. That is there are 404 error pages when you click on any category from the home page of the catalog.

RewriteBase /catalog/
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

I can confirm that the cache file has filled with categories and products, and that the URL appears to be correct according to the naming protocol. Because the URL is correct, I assume the rewrite rule to be working OK.

The problem then is in converting the rewritten URL back to the Cid and Pid to call the correct page. How does this work and what can I check?

Thanks again

#33 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 18 January 2005, 17:20

The .htaccess code should be like this:
RewriteEngine On 
RewriteBase /catalog/
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
Notice you need to have the RewriteEngine On before the others...

Bobby

#34 apexdog

  • Community Member
  • 15 posts
  • Real Name:Dan

Posted 18 January 2005, 17:26

I agree about the search & breadcrumb issue, it's not that important.

I also have this site map contribution installed http://www.oscommerce.com/community/contributions,1529

The links in that site map are not rewritten either. I am willing to hack away at it to get the SEF urls in the site map, but I don't have much php experience so I need someone to point me in the right direction.

My thoughs are to leave most of the site map code as is, but instead of displaying the product name & model with Link, put that all into a variable or array so it can be reformatted & displayed with a SEF link.

This is the code that displays the link in the site map contribution.
// display the product model and name with link (including language):
echo "<td class=main>" . $products['products_model'] . "</td><td class=main>\n<a href=\"" . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .str_replace("/", "/", rawurlencode($prod_name['products_name'])). '&products_id=' . $prod_name['products_id'] . '&language=' . $this_language_code, 'NONSSL', true) . "\">" . $prod_name['products_name'] . "</a></tr>";


#35 Bean Boy

  • Community Member
  • 9 posts
  • Real Name:N B

Posted 18 January 2005, 17:36

Chemo, on Jan 18 2005, 06:20 PM, said:

The .htaccess code should be like this:
RewriteEngine On 
RewriteBase /catalog/
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
Notice you need to have the RewriteEngine On before the others...

Bobby

<{POST_SNAPBACK}>



Ouch! How Embarrasing!!

I missed the 1st line of code in the copy and paste exercise.

Thank you very much for your help. This is now up and running fine! great Contribution.

#36 Zuber

  • Community Member
  • 33 posts
  • Real Name:Zuber

Posted 19 January 2005, 00:15

Hi Chemo,

Thanks for the excellent contribution.

Got a couple of gremlins I hope someone can help iron out.

I tried the earlier cnames version and it worked a treat.

Tried the new version and only problem is, it appears to work exactly the same.

To clarify...

Everything appears to be installed fine. Got the install page to run etc.

Everything is great except, I was keen to try the "Rewrite" option.

Problem is, when I switch it on, it does not appear to make any difference. It operates (generates links) exactly the same as the cname option.

I've wiped the contents of the cache directory. And retested, and the result is the same. Works perfectly, but only as cname regardless of setting chsen from Admin.

I've updated my .htaccess file (in the catalog directory), including changing '/folder/' to '/cat/'


Any suggestions ?

One point worth mentioning, I can't specify an apsolute path to the cache directory in the config.

It fails with can't find...

I enter '/public_html/cat/spcache/' which is the full path, but it fails miserably.

However, if I enter '../cat/spcache' it works. (but without rewrite functionality)

It is runninbg on a linux box.

details below :

Quote

Operating system Linux
Server Name  Apache version 1.3.33 (Unix)
PERL version 5.8.3
PHP version 4.3.10
MySQL version 4.0.22-standard

Thanks,

Zuber

#37 Zuber

  • Community Member
  • 33 posts
  • Real Name:Zuber

Posted 19 January 2005, 00:37

Forgot to mention,

you can take a look at www.shirtpocket.co.uk

#38 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 19 January 2005, 01:02

Zuber,

Your path is not configured correctly. A quick way of getting your full path is to create a phpinfo page.

I can tell that your path is not the FULL path.

You can contact me on AIM or MSN messenger for support on this...

Bobby

#39 Fourbit

  • Community Member
  • 96 posts
  • Real Name:Paul
  • Location:Montanan

Posted 19 January 2005, 07:26

Bobby,

I found a bit of an issue.

Seems that the products don't get added to the cache file if you use EasyPopulate to upload your new products.

For now, I just deleted the cache file and reloaded. Everything is fine. Maybe the delete file should be added to the EP program?

THat's it for tonight. THis old guy needs some sleep.

Paul

#40 Chemo

  • Banned
  • 2,486 posts
  • Real Name:Bobby
  • Location:/usa/kentucky/richmond/

Posted 19 January 2005, 07:29

It would probably be better to just add a handy reset cache button to settings. This way if something like that happens you can delete the cache file(s) without having to FTP in.

Bobby