Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

Well I don't know much about php but when I changed line 1073 from return current page to return return the same as the other lines below everything seems to be working.Maybe somebody knows if this will mess something else up.

line : 1064 to1073

 

function requested_page()

{

$protocol = ((int) $_SERVER['SERVER_PORT'] === 443)? 'https://' : 'http://';

$current_page = $protocol . $_SERVER['HTTP_HOST'] . ((!empty($_SERVER['REQUEST_URI']))? $_SERVER['REQUEST_URI'] : '');

$current_page = substr($current_page, strlen(HTTP_SERVER));

if (($pos = strpos($current_page, "?osCsid")) !== FALSE)

$current_page = substr($current_page, 0, $pos).'<br>';

if ($current_page[0] == "/")

$current_page = substr($current_page, 1);

 

Changed commented out // return $current_page;

 

Now

return $return;

 

I have no idea how or why that works, but when I made that modification to catalog>includes>classes>seo.class.php, it now seems to work fine for categories that have so many products that it takes more than one page to display them.

 

I haven't done a lot of testing, but so far, it seems to have no adverse effects.

 

Hopefully someone with more php & osCommerce experience than me can explain why this works and discuss whether or not it may potentially create other problems.

 

Thanks,

Ken Loomis

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

Hi I am new here ar osCommerce I have a new install of the latest version that I set up this week and I installed Ultimate SEO 2-2.2e on my site and all looked good I tested stuff and looked like everything was working perfectly untill today when I tried going through the categories from a surfers point of view and it won't let me past the first page I click next and page 2 page 3 page 4 page 5 ect... and they all send me back to page 1 here is the example

 

http://www.bagcloseout.com/handbags/handba...on-c-21_22.html

 

if you stroll to the bottom of this page you will see there are 5 pages in total for example the second page if you put your cursor over it shows this url

 

http://www.bagcloseout.com/handbags/handba...e=2&sort=1a

 

and page 3 looks like this

 

http://www.bagcloseout.com/handbags/handba...e=3&sort=1a

 

but when you click on them the rewrite engine sends me back to

 

http://www.bagcloseout.com/handbags/handba...on-c-21_22.html

 

Can anyone help me out with this problem what did I do wrong or is there a fix for this that has not been posted please let me know I opted in to allow emails from members so feel free to email me if you have a solution I would really appreciate it

 

Thanks

Miguel

Link to comment
Share on other sites

I have no idea how or why that works, but when I made that modification to catalog>includes>classes>seo.class.php, it now seems to work fine for categories that have so many products that it takes more than one page to display them.

 

I haven't done a lot of testing, but so far, it seems to have no adverse effects.

 

Hopefully someone with more php & osCommerce experience than me can explain why this works and discuss whether or not it may potentially create other problems.

 

Thanks,

Ken Loomis

 

Hi there, I too have this problem but I do not have the file catalog>includes>classes>seo.class.php as I am using version 2.0.

 

I cannot upgrade as I am using the cname version of the mod (I am on a windows server) and further versions no longer support cname !

 

Can anyone suggest where I might look to try and fix this problem ?

Link to comment
Share on other sites

Hi,

 

I've installed Ultimate SEO and all the links are working perfectly except for my header picture.

 

The little linking hand shows https://www.mydomain.com/ . HEADER_IMAGE_LINK .

 

when I click on it, it redirects to the error 404 page https://www.mydomain.com/.%20HEADER_IMAGE_LINK%20.

 

I suspect it's a problem with .htaccess and I've asked my host to correct the file but they said everything is set up all right in my htaccess file therefore they can't do nothing for me.

 

Does anyone know how to solve my issue?

 

Please.

 

Thanks.

 

Florence

Link to comment
Share on other sites

404 Error Continued (PHP 4.1)

 

I have set up Ultimate SEO on my site and all links (Catalog,Manufacturers etc...) lead to 404 errors.

 

All admin functions function without error.

 

The links all appear very clean (I.E. Looks like the pointers are accurate) but there are no HTML pages to link to....

 

The .htaccess file is set up properly but I am not sure if it is being accessed/enabled properly.

 

My site actually has a re-direct from the Root (.htaccess) to my sub directory osCommerce/catalog/index.php

I updated the .htaccess file in the directory osCommerce/catalog as per the Ultimate SEO upgrade instructions.

 

I also tried an put it in my root directory with the same affect.

 

Is there any way I can verify my set-up ?

Link to comment
Share on other sites

Hello everyone!

 

I have tried to install ultimate SEO, but I seem to hit a snag.....any help would be appreciated! This testing was performed on a localhost, using latest WAMP. I seem to believe that my .htaccess is the problem, but I'm not sure. Here is what it looks like:

 

 

# $Id: $

#

# This is used with Apache WebServers

#

# For this to work, you must include the parameter 'Options' to

# the AllowOverride configuration

#

# Example:

#

# <Directory "/usr/local/apache/htdocs">

# AllowOverride Options

# </Directory>

#

# 'All' with also work. (This configuration is in the

# apache/conf/httpd.conf file)

 

# The following makes adjustments to the SSL protocol for Internet

# Explorer browsers

 

#<IfModule mod_setenvif.c>

# <IfDefine SSL>

# SetEnvIf User-Agent ".*MSIE.*" \

# nokeepalive ssl-unclean-shutdown \

# downgrade-1.0 force-response-1.0

# </IfDefine>

#</IfModule>

 

# If Search Engine Friendly URLs do not work, try enabling the

# following Apache configuration parameter

 

# AcceptPathInfo On

 

# Fix certain PHP values

# (commented out by default to prevent errors occuring on certain

# servers)

 

# php_value session.use_trans_sid 0

# php_value register_globals 1

 

Options +FollowSymLinks

RewriteEngine On

RewriteBase /

 

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}

 

 

When I try to pull up the index page I get this:

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Any ideas?

Link to comment
Share on other sites

Well I don't know much about php but when I changed line 1073 from return current page to return return the same as the other lines below everything seems to be working.Maybe somebody knows if this will mess something else up.

line : 1064 to1073

 

function requested_page()

{

$protocol = ((int) $_SERVER['SERVER_PORT'] === 443)? 'https://' : 'http://';

$current_page = $protocol . $_SERVER['HTTP_HOST'] . ((!empty($_SERVER['REQUEST_URI']))? $_SERVER['REQUEST_URI'] : '');

$current_page = substr($current_page, strlen(HTTP_SERVER));

if (($pos = strpos($current_page, "?osCsid")) !== FALSE)

$current_page = substr($current_page, 0, $pos).'<br>';

if ($current_page[0] == "/")

$current_page = substr($current_page, 1);

 

Changed commented out // return $current_page;

 

Now

return $return;

 

dude u rock!

Link to comment
Share on other sites

To everyone having 404 Errors or 500 Internal server errors after installing this contribution.

 

This is all down to the .htaccess edit in the contribution.

This one NEEDS register_globals on which is settable in the PHP.ini file that the webhost only has access too.

They usually will not change this to ON because it can cause a security risk.

If you are doing this on your own server, you can enable this option yourselves in php.ini.

 

Unfortunately, if your host has told you they are not going to turn the register_globals to on, then you are pretty much gonna have to uninstall this contribution or wait for a rewrite function added into the coding of the PHP.

 

You can check this by simply creating a phpinfo.php file containing the following code

<?php phpinfo(); ?>

Upload the phpinfo.php code to your server. Call it from http://www.myserver.com/phpinfo.php

 

Press CRTL-F and find 'Register_Globals' and check the status of it.

 

If yours is off. Sorry this is never going to work!

 

If it's on, you have a different reason for your error!

 

OSCommerce RC1, apparantely has a patch added from the previous version to help it work with 'register_globals' off. But some Mods that still need to use htaccess files will not function.

 

Sorry to be the bearer of bad news. But lots have asked and I thought it was high time someone explained!

Link to comment
Share on other sites

If you have any issues be sure to post:

 

Server info (Apache on *NIX machine, etc)

Exact problem

What you've tried to solve it

...and any debuggin you've done

 

When you get done with the install come back and give me some feedback on the install and functionality. I'm particularly interested in making this as easy to install as possible.

 

Bobby

 

:thumbsup:

 

I'm very new at this, but your instructions were thorough and easy to understand. Only thing I am not 100% clear on is STEP #6 - Edit .htaccess file (in your catalog directory). I did the directoy correct, but not clear if to remove what existed in that file and replace it with the new code or add the new code after. Anyhow, I choose to add the new code after thlast line and and all seems to be working great. I did experiment with it both ways and both ways seem to work the same. Should I remove what existed? or does it matter? I don't want to keep anything that's not necessary. And Thank you for this nugget!

 

Here's what existed:

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $

#

# This is used with Apache WebServers

#

# For this to work, you must include the parameter 'Options' to

# the AllowOverride configuration

#

# Example:

#

# <Directory "/usr/local/apache/htdocs">

# AllowOverride Options

# </Directory>

#

# 'All' with also work. (This configuration is in the

# apache/conf/httpd.conf file)

 

# The following makes adjustments to the SSL protocol for Internet

# Explorer browsers

 

<IfModule mod_setenvif.c>

<IfDefine SSL>

SetEnvIf User-Agent ".*MSIE.*" \

nokeepalive ssl-unclean-shutdown \

downgrade-1.0 force-response-1.0

</IfDefine>

</IfModule>

 

# If Search Engine Friendly URLs do not work, try enabling the

# following Apache configuration parameter

#

# AcceptPathInfo On

 

# Fix certain PHP values

# (commented out by default to prevent errors occuring on certain

# servers)

#

#<IfModule mod_php4.c>

# php_value session.use_trans_sid 0

# php_value register_globals 1

#</IfModule>

 

I added under the last line #</IfModule>:

 

Options +FollowSymLinks

RewriteEngine On

RewriteBase /land_cruiser_parts/catalog/

 

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}

Link to comment
Share on other sites

404 Error Continued (PHP 4.1)

 

I have set up Ultimate SEO on my site and all links (Catalog,Manufacturers etc...) lead to 404 errors.

 

All admin functions function without error.

 

The links all appear very clean (I.E. Looks like the pointers are accurate) but there are no HTML pages to link to....

 

The .htaccess file is set up properly but I am not sure if it is being accessed/enabled properly.

 

My site actually has a re-direct from the Root (.htaccess) to my sub directory osCommerce/catalog/index.php

I updated the .htaccess file in the directory osCommerce/catalog as per the Ultimate SEO upgrade instructions.

 

I also tried an put it in my root directory with the same affect.

 

Is there any way I can verify my set-up ?

 

Answered my own questions....

 

Here are some key tips to verify if mod_rewrite is working on your site

 

http://www.tutorio.com/tutorial/enable-mod-rewrite-on-apache

 

Most of the references to enable Mod_rewrite involve updating the apache web server to support 'Allow Override Options’ . As my provider doesn't allow for this for security reasons, a little further investigation showed that this module was enabled on the server but that the mode_rewrite function had not been propagated to my virtual directory.

 

Simply by adding the following 2 lines to the .htaccess file and the function was working

 

RewriteEngine On

RewriteOptions Inherit

 

Want to know more check out the apache server site mod_rewrtie function

 

IF you ware working with a virtual host/provider chances are that this is all your will need to get the ultimate seo tools working for your site. It seems that most providers do support mod_rewrite.

 

Hope this helps a fw of you out there...

Link to comment
Share on other sites

I installed Ultimate SEO URLs, cleared all caches, reloaded the catalog page, it seemed fine, each of the product URLs is clean and neat. But when I clicked the product links, they all turned "404 not found" pages. I have followed all instructions, could any one told me how I could remedy this? Thanks! I am using Bluehost.

Link to comment
Share on other sites

Simply by adding the following 2 lines to the .htaccess file and the function was working

 

RewriteEngine On

RewriteOptions Inherit

 

Want to know more check out the apache server site mod_rewrtie function

 

IF you ware working with a virtual host/provider chances are that this is all your will need to get the ultimate seo tools working for your site. It seems that most providers do support mod_rewrite.

 

Hope this helps a fw of you out there...

 

I also tried what you said, but it did not work for me.:(

Link to comment
Share on other sites

To everyone having 404 Errors or 500 Internal server errors after installing this contribution.

 

This is all down to the .htaccess edit in the contribution.

This one NEEDS register_globals on which is settable in the PHP.ini file that the webhost only has access too.

They usually will not change this to ON because it can cause a security risk.

If you are doing this on your own server, you can enable this option yourselves in php.ini.

 

I set register_globals on already! Still got 404!! :huh:

Link to comment
Share on other sites

I checked the error_log and found I got a lot of "cannot use a full URL in a 401 ErrorDocument directive --- ignoring!", I think this might be where the problem is. Could any one help me with this? :-"

Link to comment
Share on other sites

I checked the error_log and found I got a lot of "cannot use a full URL in a 401 ErrorDocument directive --- ignoring!", I think this might be where the problem is. Could any one help me with this? :-"

CHEERS~!!I figured it out! I changed the "RewriteBase /directory/ " in .htaccess file to my own directory name, that is "RewriteBase /catalog/ " and it is OK now! Please forgive the dumbness of a person without any programing knowledge!!!

Link to comment
Share on other sites

Greetings.

 

 

I got this contribution working about 95%, the missing 5% being one strange phenomenon:

 

When I click on a product review link (PRODUCTNAME-pr-ID.html), I get redirected to the corresponding product

page (PRODUCTNAME-p-ID.html). Any idea on where this little beauty of a bug lies hidden?

 

Yours,

 

Alexander

 

The corresponding part of the .htaccess, the directory is ok, rewrites other than the reviews work:

 

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}

Link to comment
Share on other sites

Greetings.

I got this contribution working about 95%, the missing 5% being one strange phenomenon:

 

When I click on a product review link (PRODUCTNAME-pr-ID.html), I get redirected to the corresponding product

page (PRODUCTNAME-p-ID.html). Any idea on where this little beauty of a bug lies hidden?

 

Yours,

 

Alexander

 

The corresponding part of the .htaccess, the directory is ok, rewrites other than the reviews work:

 

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}

 

Hi check contributions

http://www.oscommerce.com/community/contributions,2823

 

3chaitanya

 

Scope: Bug in Ultimate SEO 2-2.2e.

I am not sure if it exists or added in this version.

 

Bug description: When one clicks to check review page by clicking review link on product_info page, it

 

redirects to same Product info page.

 

In /catalog/includes/classes/seo.class.php

Under function ValidateName

 

Find:

if ((strpos($parts[count($parts) - 2], $type)) !== FALSE)

 

Replace with:

if ($parts[count($parts) - 2] == $type)

 

might help

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Hi check contributions

http://www.oscommerce.com/community/contributions,2823

 

3chaitanya

 

Scope: Bug in Ultimate SEO 2-2.2e.

I am not sure if it exists or added in this version.

 

Bug description: When one clicks to check review page by clicking review link on product_info page, it

 

redirects to same Product info page.

 

In /catalog/includes/classes/seo.class.php

Under function ValidateName

 

Find:

if ((strpos($parts[count($parts) - 2], $type)) !== FALSE)

 

Replace with:

if ($parts[count($parts) - 2] == $type)

 

might help

 

Hi,

 

did help - works like a charm now.

 

Alexander

Link to comment
Share on other sites

Hello Chemo I installed this about 2 years ago and it has greatly helped with search engine rank, THANK YOU VERY MUCH.

 

I have a problem now, I've read most osCommerce MS2 Contributions are not MySQL 5 compatible. My site is still hosted on a server with MySQL 4, I am migrating the website to a new dedicated server with MySQL 5 and cannot get the products to show, I can only get the products to show on the server with MySQL 4 installed. Do you plan to or have you realesed any updates to make this contribution compatible with MySQL 5?

 

The new dedicated server techs are trying to mirror my old server set up by installing MySQL 4 etc but they said this will ulimately leed to security holes as its no longer supported. The 2 main contributions I have installed are this and the header tags by Jack so i'm going to ask Jack as well. I've seached and could not find any updates for MySQL5 so appologies in advance is this question has been asked many times.

Link to comment
Share on other sites

Upon installing Ultimate SEO URLS I got a 500 error, so I removed "Options +FollowSymLinks" from the .htaccess to get it working again. Then I checked out my catalog to find all categories and products returning 404's.

 

I checked the server and registered globals is ON. I read somewhere that the solution may be to add "RewriteOptions Inherit" underneath "RewriteEngine On" like this

 

RewriteEngine On

RewriteOptions Inherit

 

in the .htaccess. Well, I did that and got a 500 error, so I removed it and I'm still getting a 500 error. Nothing else was changed in the file. What could be wrong?

 

I've installed Ultimate SEO URLS on an estarr server and it works great, but now I'm having problems installing on a 1and1 server. Could it be 1and1?

I'm working on multiple stores with multiple problems.

Link to comment
Share on other sites

Upon installing Ultimate SEO URLS I got a 500 error, so I removed "Options +FollowSymLinks" from the .htaccess to get it working again. Then I checked out my catalog to find all categories and products returning 404's.

 

I checked the server and registered globals is ON. I read somewhere that the solution may be to add "RewriteOptions Inherit" underneath "RewriteEngine On" like this

 

RewriteEngine On

RewriteOptions Inherit

 

in the .htaccess. Well, I did that and got a 500 error, so I removed it and I'm still getting a 500 error. Nothing else was changed in the file. What could be wrong?

 

I've installed Ultimate SEO URLS on an estarr server and it works great, but now I'm having problems installing on a 1and1 server. Could it be 1and1?

 

^ fixed the 500 error but I'm still getting the 404's. Any help would be greatly appreciated, really.

I'm working on multiple stores with multiple problems.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...