Jump to content
spidometrs

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

Recommended Posts

hello,

 

how can i have the SEO URLs only in one language? I mean that if I'm browsing the shop in German lang the urls to be on English always.

 

thanks

Share this post


Link to post
Share on other sites
hello,

 

how can i have the SEO URLs only in one language? I mean that if I'm browsing the shop in German lang the urls to be on English always.

 

thanks

 

 

Yup open up includes/classes/seo.class.php

 

Find ..

 

$this->languages_id = (int)$languages_id;

 

Replace with ..

 

//$this->languages_id = (int)$languages_id;
$this->languages_id = 1;

 

Where 1 is the language you require.

Share this post


Link to post
Share on other sites

Hello everyone,

How can I change spaces to "-"

 

example:

 

/someproductshere-p-454.html

 

will be:

 

/some-products-here-p-454.html

 

 

And also I need a different rewrite type:

 

/p-454-some-products-here.html

 

thanks for help

Share this post


Link to post
Share on other sites
HI,

Coming back to get the support from teh pros on this forum -

I had implemented this contribution and everything worked fine.

However, if I typed my old URLs in the browser or had a flash piece that had old style dynamic URL as a link, that would take me to weird pages. For category pages, it would take me to: index.php?catalog=index.php

and for product pages, it would take me to: product_info.php?catalog=product_info.php

 

I am not sure if there is something in my code or if there is something in my settings. My phpinfo file is at:

http://www.india1imports.com/phpinfo.php

 

For now, I have turned the contribution off and unloaded it, but if someone could help me figure this out, it would be great. I am willing to even pay for someone to help me figure this out, since I am not able to get my dynamic URLs into googles indexed sites even after submitting the sitemap to them multiple times. None of my product pages are in search indexes and it is killing my business.

 

Any experts want to make a little fast money?

 

Thanks,

Abhay

I finally found the problem. There are clues to the problem even by some other versions of this contribution, but since I blindly went with v 2.1d ORIGINAL Updated, it did not have the fix.

 

In order for my old URLs to work after I implement the contribution, I had to comment out a few lines in seo.class.php. The last function in the file is do_redirect(). There are a few lines in the function:

header("HTTP/1.0 301 Moved Permanently");

$url = str_replace('&', '&', $url);

header("Location: $url"); // redirect...bye bye

 

I changed them to:

// header("HTTP/1.0 301 Moved Permanently");

$url = str_replace('&', '&', $url);

// header("Location: $url"); // redirect...bye bye

 

The question is what were they doing and is there any side effect of doing so?

 

Thanks,

Abhay

Share this post


Link to post
Share on other sites
but since I blindly went with v 2.1d ORIGINAL Updated, it did not have the fix.

 

That's because it has no need of a fix.

 

 

 

Yes there is a big side effect.

 

USU looks at the incoming url and decides whether it should be an seo url if it is an old type url that should be converted to an seo url USU 301 directs users (AND SPIDERS) to the USU version.

 

You have totally removed this functionality.

 

If what you actually want to do is remove the contribution then just reverse the instructions.

Share this post


Link to post
Share on other sites
That's because it has no need of a fix.

 

 

 

Yes there is a big side effect.

 

USU looks at the incoming url and decides whether it should be an seo url if it is an old type url that should be converted to an seo url USU 301 directs users (AND SPIDERS) to the USU version.

 

You have totally removed this functionality.

 

If what you actually want to do is remove the contribution then just reverse the instructions.

 

Can you please explain the last line more clearly?

 

Also, before commenting these lines, the old style URLs were just not working. That is a functionality issue.

Having these lines redirect the old style URL to new style URL is more of a feature. There must be a reason that without commenting these lines, the old URLs are working for other folks who have implemented USU.

In any case, since I cannot find that cause, I will make this sacrifice in order to get partial benefits and still not look as if the web site is broken if old URL style link comes in.

 

Thanks,

Abhay

Share this post


Link to post
Share on other sites
Can you please explain the last line more clearly?

 

Cant think how to make that clearer.

 

You must have some odd server settings that are causing the problems.

 

I noticed in php.ini you have ..

 

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

 

What's that for when osc requires ..

 

session.use_trans_sid = 0

Share this post


Link to post
Share on other sites
Cant think how to make that clearer.

 

You must have some odd server settings that are causing the problems.

 

I noticed in php.ini you have ..

 

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

 

What's that for when osc requires ..

 

session.use_trans_sid = 0

 

Hi Robert,

The goal is not to undo the contribution otherwise I would have left it long back. Also, I know how to uninstall the contribution. I have already done it multiple times during debugging.

 

Do you have a sample of a clean php.ini file? I could compare my php.ini and see what are the defaults.

 

Thanks

Abhay

Share this post


Link to post
Share on other sites
Hi Robert,

The goal is not to undo the contribution otherwise I would have left it long back. Also, I know how to uninstall the contribution. I have already done it multiple times during debugging.

 

Do you have a sample of a clean php.ini file? I could compare my php.ini and see what are the defaults.

 

Thanks

Abhay

 

One more question: Once we change php.ini, do we have to do something for it to be effective or is it picked up by itself?

 

Sorry for the ignorance.

BTW, I tried replacing the url_rewriter.tags line in php.ini with the session..line that you suggested. Then, I uncommente dteh two lines in the seo.class.php and the site stopped working as before for the old URLs.

 

-Abhay

Share this post


Link to post
Share on other sites
One more question: Once we change php.ini, do we have to do something for it to be effective or is it picked up by itself?

 

Sorry for the ignorance.

BTW, I tried replacing the url_rewriter.tags line in php.ini with the session..line that you suggested. Then, I uncommente dteh two lines in the seo.class.php and the site stopped working as before for the old URLs.

 

-Abhay

 

okay - one more question on this

Without the redirection from old URL to the new one, I have both old and new URL pointing to the same page.

Does that mean that the Google spiders will see this as duplicate pages. Do I get penalized to have both new and old URLs pointing to same page, but old URLs not redirected to the new page?

 

Help!!! The whole exercise will go waste if I get penalized for the duplicate pages...

 

Thanks

Abhay

Share this post


Link to post
Share on other sites
okay - one more question on this

Without the redirection from old URL to the new one, I have both old and new URL pointing to the same page.

Does that mean that the Google spiders will see this as duplicate pages. Do I get penalized to have both new and old URLs pointing to same page, but old URLs not redirected to the new page?

 

Help!!! The whole exercise will go waste if I get penalized for the duplicate pages...

 

Thanks

Abhay

 

Hi Robert,

So, I looked and looked and after lot of looking, I found a possible mistake. Before I declare myself winner, I thought I will get second opinion.

 

Inside the function check_redirect() in seo.class.php, I made the following change:

$this->uri_parsed = $this->not_null( $this->path_info )
                                                               //?        parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($this->path_info) )
															?        parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($_SERVER['QUERY_STRING']) )
                                                               :        parse_url(basename($_SERVER['REQUEST_URI']));

 

Look at the conditional statement. Its only supposed to strip the path off the REQUEST_URL if the path_info is not null. So, for people who have their catalog sitting in the root directory, they are fine. But, for people like me who have an explicit /catalog/ directory, I go to the true part of the conditional statement. NOw, the parameter appended after the "?" should be the argument like cPath=xx&page=xx&sort=xx. Instead teh parameter passed on after "?" is the $path_info which is more like catalog/index.php. The return of the parse_path() makes it look like catalog=index.php. This is absurd. The function parse_path was looking to receive the argument part and not the path part.

 

After this change it all works fine. I have uncommented the header() statements and if I type old URL, the web site is automatically pointed over to the corresponding new URL. So, no issue of duplicate URLs.

 

Bottomline - do you see any flaw in the change I made above?

 

Thanks,

Abhay

Share this post


Link to post
Share on other sites
Hi Robert,

So, I looked and looked and after lot of looking, I found a possible mistake. Before I declare myself winner, I thought I will get second opinion.

 

Inside the function check_redirect() in seo.class.php, I made the following change:

$this->uri_parsed = $this->not_null( $this->path_info )
                                                               //?        parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($this->path_info) )
															?        parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($_SERVER['QUERY_STRING']) )
                                                               :        parse_url(basename($_SERVER['REQUEST_URI']));

 

Look at the conditional statement. Its only supposed to strip the path off the REQUEST_URL if the path_info is not null. So, for people who have their catalog sitting in the root directory, they are fine. But, for people like me who have an explicit /catalog/ directory, I go to the true part of the conditional statement. NOw, the parameter appended after the "?" should be the argument like cPath=xx&page=xx&sort=xx. Instead teh parameter passed on after "?" is the $path_info which is more like catalog/index.php. The return of the parse_path() makes it look like catalog=index.php. This is absurd. The function parse_path was looking to receive the argument part and not the path part.

 

After this change it all works fine. I have uncommented the header() statements and if I type old URL, the web site is automatically pointed over to the corresponding new URL. So, no issue of duplicate URLs.

 

Bottomline - do you see any flaw in the change I made above?

 

Thanks,

Abhay

 

I'm looking into this I'm sure you have got something here as I have seen this catalog=index.php before. I'm thinking at this stage it may have something to do with the use of getenv('PATH_INFO') and the fact that it can report differently for differing server configs e.g. php CGI

Share this post


Link to post
Share on other sites

@Abhay

 

Can you check admin>configuration>My Store please and check that Use Search-Engine Safe URLs (still in development) is set to false.

Share this post


Link to post
Share on other sites
@Abhay

 

Can you check admin>configuration>My Store please and check that Use Search-Engine Safe URLs (still in development) is set to false.

Yes, that is set to False. I have played with it in past and turning it on messes things up. In my case, it is set to false from beginning.

 

Thanks,

Abhay

Share this post


Link to post
Share on other sites
Yup open up includes/classes/seo.class.php

 

Find ..

 

$this->languages_id = (int)$languages_id;

 

Replace with ..

 

//$this->languages_id = (int)$languages_id;
$this->languages_id = 1;

 

Where 1 is the language you require.

 

Thanks! That solves one of my problems. Greek urls look funny with SEO.

 

I have installed the contribution on another site and everything works except the title doesn't change according to the product name.

The urls have changed to http://www.mysite.com/catalog/bunnies-mode...ting-p-785.html

Shouldn't the title of the page be bunnies-modern-colours-painting?

Did I miss something or is that part of another contribution?

 

Thanks very much.

Share this post


Link to post
Share on other sites
Hi Robert,

So, I looked and looked and after lot of looking, I found a possible mistake. Before I declare myself winner, I thought I will get second opinion.

 

Inside the function check_redirect() in seo.class.php, I made the following change:

$this->uri_parsed = $this->not_null( $this->path_info )
                                                               //?        parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($this->path_info) )
															?        parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($_SERVER['QUERY_STRING']) )
                                                               :        parse_url(basename($_SERVER['REQUEST_URI']));

 

Look at the conditional statement. Its only supposed to strip the path off the REQUEST_URL if the path_info is not null. So, for people who have their catalog sitting in the root directory, they are fine. But, for people like me who have an explicit /catalog/ directory, I go to the true part of the conditional statement. NOw, the parameter appended after the "?" should be the argument like cPath=xx&page=xx&sort=xx. Instead teh parameter passed on after "?" is the $path_info which is more like catalog/index.php. The return of the parse_path() makes it look like catalog=index.php. This is absurd. The function parse_path was looking to receive the argument part and not the path part.

 

After this change it all works fine. I have uncommented the header() statements and if I type old URL, the web site is automatically pointed over to the corresponding new URL. So, no issue of duplicate URLs.

 

Bottomline - do you see any flaw in the change I made above?

 

Thanks,

Abhay

 

Hi,

I have the same problem as you. I have installed it on one site with no problem.

The other site is hosted on Godaddy but when I click on manufacturers I end up on the catalog page. When I click to change currencies I get a product not found. I have a php.ini file like yours.

Could you let me know what changes you made to make it work?

 

Thank you in advance,

Alexandra

Share this post


Link to post
Share on other sites

Ok, based on your post I changed

 

parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($this->path_info) )

 

to

parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $this->parse_path($_SERVER['QUERY_STRING']) )

 

and it works on this site.

 

So on one site hosted with host x the top code works. On another site hosted elsewhere it works with bottom code.

 

The only thing is that the title doesn't change when you click on a product. I checked other member's sites that have posted on this thread and for some only the url changes and for others both the url and the title changes. I saw one member where the title changes but not the url.

I would like for the title to change also so if anyone has any ideas how to do that please post.

 

Many thanks,

Alexandra

Share this post


Link to post
Share on other sites

I have heard Ultimate SEO URLs is a good contrib to install. I read the install.txt. It mentions that five existing files will be changed, but does not specify what changes will be made by the installation.

 

Therefore, I can't determine whether installation will interfere with some of the other contributions already installed.

This means that I am hesitant to do the install.

 

Any advice?

Share this post


Link to post
Share on other sites
I have heard Ultimate SEO URLs is a good contrib to install. I read the install.txt. It mentions that five existing files will be changed, but does not specify what changes will be made by the installation.

 

Therefore, I can't determine whether installation will interfere with some of the other contributions already installed.

This means that I am hesitant to do the install.

 

Any advice?

 

Just install it .. make sure you have the "experimental" osc seo urls turned off.

 

I've yet to work on an oscommerce site where version 2.1d UPDATED causes issues.

 

The instructions are very simple just make sure you follow them to the letter especially the RewriteBase in .htaccess.

 

It self installs, really a very simple install for such a powerful contribution.

Share this post


Link to post
Share on other sites

Hello,

 

nice contribution. how do you handle the other pages like the contact.php, or everything else for example of the information box. there the url still is /catalog/contact.php for example.

 

so you accept a mixed url structure?

 

thx jupiters

Edited by Jupiters

Share this post


Link to post
Share on other sites
Hello,

 

I need your help from seo.class.php. My categorie from Domain http://www.flechtwaren24.de/blumen-c-20079.html . I need it so http://www.flechtwaren24.de/blumen.html. What can i do?

 

Thanks Alfred

 

Hi Alfred

 

I'm afraid it is impossible (with current SEO URLS coding anyway)

 

SEO URLS uses -c-20079 to convert the incoming URL to the oscommerce normal (cPath=20079) without it there would be no way to recreate the standard cPath that oscommerce requires.

 

Even outside of SEO URLS you would be relying on the text .. blumen.html .. being unique which is never ideal, far better to use auto incremented ids that are forced to be unique.

Share this post


Link to post
Share on other sites
Hello,

 

I need your help from seo.class.php. My categorie from Domain http://www.flechtwaren24.de/blumen-c-20079.html . I need it so http://www.flechtwaren24.de/blumen.html. What can i do?

 

Thanks Alfred

 

Hi Alfred,

 

Hope you have the time to answer my question. You have a very nice site by the way.

When I click on one of your products or categories the url changes which is done by the SEO contribution. However your title changes as well. Is this part of the SEO contribution or did you add another contribution to do that?

 

Thank you in advance,

Alexandra

Share this post


Link to post
Share on other sites
Hi Alfred,

 

Hope you have the time to answer my question. You have a very nice site by the way.

When I click on one of your products or categories the url changes which is done by the SEO contribution. However your title changes as well. Is this part of the SEO contribution or did you add another contribution to do that?

 

Thank you in advance,

Alexandra

 

 

Hi Alexandra,

 

Thanks for the compliment.

The title is automatically created. Has nothing to do with SEO tool to do so.

That is what I created.

If a query If

<?php if(( substr_count($_SERVER['REQUEST_URI'], 'create_account.php')))

{

?>

<title>Create Account</title>

<?php

} else { ?>

<title><? echo STORE_NAME; ?></title>

}

[/ code]

That you for all files.

products_news, specials, etc.pp

 

OK?

 

Regards

Alfred

Share this post


Link to post
Share on other sites

Hi.

 

i am install last version Ultimate SEO .... but i have one problem...

 

When i enter in my page www.cdkeysnow.com

 

Where i can change my title and my meta tags?

 

<title>Loja Virtual</title>
<meta name="description" content="">
<meta name="keywords" content="">

 

Thanks for help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×