Jump to content
Chemo

[Contribution] Ultimate SEO URLs - by Chemo

Recommended Posts

Bobby,

 

I am in the process of moving my catalog directory to the root. Before I transfer the files and make this change "live", I am wondering about indexed pages with the search engines. What is the best way to redirect them to the new directory structure (ie, www.mydomain.com/catalog/product-name-p-1.html to www.mydomain.com/product-name-p-1.html and the rest...)?

 

I don't have any rankings yet (been live since Jan'05) but I don't want to slow down the process...

 

Thanks in advance for the continued support!


Brian Neuman

Share this post


Link to post
Share on other sites
I have looked over the code at least 5 times now and the ONLY way I can see where that situation would present is if you have the stock osC option of SEF URLs enabled. If this is the case please disable the option and the return URL for the product on the shopping cart page will function correctly.

 

The problem is in the code where if the SEF is enabled it strips everything and replaces them with forward slashes. For example, products_info/products_id/XX. Directly after transforming it the proper separator to use is the "?" character. Notice that the faulty URL you provided has 2 "?" marks (the second should be an "&" symbol). The "?" character tells the server that everything following are parameters and not part of the file name. The "&" character tells the server where one ends and another parameter begins.

 

Turn off the option and report back as to whether that handled the issue.

 

Admin Control Panel -> Configuration -> My Store -> Use Search-Engine Safe URLs (still in development) -> FALSE

 

Bobby

Hi Bobby,

 

thanks for the answer.

 

First of all, the "Search-Engine Safe URLs" is alway on FALSe on each of my store. The problem is not from because of this test condition :

 

if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {

....cause i've tryed to debug it.

 

the problem seems to be when i have my url coming with the implode_assoc's function.

 

When i try to debug, i've done this

echo "<br />".$link;

just after your code on line

    if (tep_not_null($parameters)) {
     $link .= $page . '?' . tep_output_string($parameters);  

 

result is :

http://localhost/***/catalog/product_info.php?products_id=122{1}1

 

after in your code, we have this

 

$params_stripped = implode_assoc($params);

 

and after

 

    $seo_rewrite_link .= $rewrite_page . ( tep_not_null($params_stripped) ? '?'.tep_output_string($params_stripped) : '' );   
   $separator = ( tep_not_null($params_stripped) ? '&' : '?' );

it seems than $params_stripped is NULL with "product_info.php?products_id=122{1}1"

 

I could add a test after

$separator = ( tep_not_null($params_stripped) ? '&' : '?);'

to check if already exist a "?" character but i'm not sure that could solve properly the problem.

 

thanks by advance for your help Bobby.

 

C?dric

Share this post


Link to post
Share on other sites
Bobby,

 

I am in the process of moving my catalog directory to the root.  Before I transfer the files and make this change "live", I am wondering about indexed pages with the search engines.  What is the best way to redirect them to the new directory structure (ie, www.mydomain.com/catalog/product-name-p-1.html to www.mydomain.com/product-name-p-1.html and the rest...)?

 

I don't have any rankings yet (been live since Jan'05) but I don't want to slow down the process...

 

Thanks in advance for the continued support!

Add this bit of code to the htaccess folder once you move it to the root:

Redirect permanent /catalog http://yourdomain.com/

Of course, change the "catalog" to the name of the old directory and "yourdomain.com" to your domaiin.

 

Hi Bobby,

 

thanks for the answer.

 

First of all, the "Search-Engine Safe URLs" is alway on FALSe on each of my store. The problem is not from because of this test condition :

 

thanks by advance for your help Bobby.

 

C?dric

Cedric,

 

Your problem is unusual since if the SEO URLs is deactivated because of an encountered error (such as in the attributes) it will render the stock osC URL code. So, I'm at a loss.

 

Bobby

Share this post


Link to post
Share on other sites
Cedric,

 

Your problem is unusual since if the SEO URLs is deactivated because of an encountered error (such as in the attributes) it will render the stock osC URL code. So, I'm at a loss.

 

Bobby

does that mean, the Rewrite Rule with SEO is not compatible with the attributes options ?

 

Please confirm, if so, i will contact you in private to give you what to do in order to solve the problem.

 

C?dric

Share this post


Link to post
Share on other sites

Thanks Chemo, the popup image thing works great!

 

One more quick question... Some of my product names are bolded, so the name is actually "<b>Whatever</b>". Works fine for most purposes, but many of my SEO urls look like "cobracards.com/bwhateverb-image-....."

 

Would it be possible to add something to the "short_name" function to remove "<b>" and "</b>"? Seems like it would be a pretty simple modification, but that code looks totally foreign to me so I didn't want to mess with it. :)

 

Thanks!

Share this post


Link to post
Share on other sites
Thanks Chemo, the popup image thing works great!

 

One more quick question... Some of my product names are bolded, so the name is actually "<b>Whatever</b>".  Works fine for most purposes, but many of my SEO urls look like "cobracards.com/bwhateverb-image-....."

 

Would it be possible to add something to the "short_name" function to remove "<b>" and "</b>"?  Seems like it would be a pretty simple modification, but that code looks totally foreign to me so I didn't want to mess with it.  :)

 

Thanks!

http://www.php.net/strip_tags :thumbsup:

Share this post


Link to post
Share on other sites

Minor problem,

 

With this mod, if you ever change a page name or move a page and want to use. htacess to redirect,

 

like RedirectPermanent /lasjdfl http://www.alasajdf/ajldfjsa

 

When you click on the old page in say google, it will go to the new page, but with the category and product number added on the end of the .html as well. It will most likely get indexed like this, then which is not good.

 

To solve, i had to permanently drop a page, create a new one and wait for it to be indexed, which doesnt transfer any page rank at all.

 

Any ideas on this one?

Share this post


Link to post
Share on other sites

Hello all,

 

I found that contributions really cool.

 

The rewriting for categories and products works pretty well but i'm still having some problems with the maufacturers rewriting.

It's seems to it doesn't works or works strangely. I mean when i click on a manufacturers the links in the adress bar is still like that : http://medimpex.com.mx/generic/index.php?manufacturers_id=11

 

But the strange is when i want to change the language i have this link :

http://medimpex.com.mx/generic/laboratorio...uage/en/sort/3a

 

So the rewriting seems to works in some way. And in this link there is my second problem, i can't use parameter correctly.

For example the contact_us page don't want to work as well :

http://medimpex.com.mx/generic/contact_us.php/action/send

 

All the parameter like ?xx=xx has changed to /...

 

I'm lost :blink:

Share this post


Link to post
Share on other sites

Ok sorry i find the answer to the parameter problem in another previous post.

 

But my manufacturer problem still here :

I chose a manufacturer and i have this link :

 

http://medimpex.com.mx/generic/index.php?manufacturers_id=11

 

But when i want to change language i have this :

http://medimpex.com.mx/generic/laboratorios-bajamed-m-11.html?language=en&sort=3a

 

So the rewriting seems to works but not from the beginning.

 

 

 

I also have a question for the better ranking. I asking myself what is better between this 2 possibility :

 

- the root directory of the domain : http://medimpex.com.mx/

- a specific folder with a keyword : http://medimpex.com.mx/generic/

 

What do you think about that ?

Share this post


Link to post
Share on other sites

Hi Bobby!!

 

Right, after a lot of hair pulling and teeth gnashing, we have come to a few conclusions about my ultimate seo setup; to give others a brief background, I installed this a while back and have got great results from all major search engines, and many orders. All of a sudden 3 days ago, BANG everything returned a 404 error page, and the only way I could get my site operational was to completely remove ultimate seo from the code. Every time I tried to re-add it to application_top, my site went haywire again.

 

Bobby tried with me last night to see what the problem was, and between us we were completely stumped. By careful tweaking, I now have (nearly) all the code into my application_top file, and my site still works. The bit which breaks my site every single time i add it in is this line of code:

 

	$cache->get_cache('GLOBAL');

Does anybody have any idea

1) why this causes my site to return a 404 error (which btw is not my servers 404 page but a generic 404 error page...?)

2) why all of a sudden on sunday evening this line decided to cause problems, bearing in mind that I am the only person with access to my server, and I was tucked up in bed...?

 

Anyway, another little glitch I have noticed which may or may not be related is this - when I turn on ultimate SEO's in my control panel, it is nearly impossible to login and order anything on my site as every page returns a brand new session_id - you can log in, look at an item, when you go to add it to basket, the site wants you to login. Now login, the site has forgotten why you wanted to login to begin with! Sure fire way to frustrate customers!! The second you set ultimate seo to off, the sessions remain static and customers can order....

 

Is this all part and parcel of the same issue, and if so what??? I know it is infuriating having large httpd.conf files posted on the forums, so anybody who is interested can pick mine up by instant messaging me - the msn im address is on my member card, or send me a private message through the forum.... :thumbsup:


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites

Tony,

 

I'm willing to be the farm that the issue is in your Apache configuration file. The reason is that the admin directory was redirecting to another location on your site. If this is not done in the htaccess file it can only happen from the Apache config file. I checked that there were no redirects in an HTML or PHP file as well.

 

Bobby

Share this post


Link to post
Share on other sites
Hi Bobby!!

 

Right, after a lot of hair pulling and teeth gnashing, we have come to a few conclusions about my ultimate seo setup; to give others a brief background, I installed this a while back and have got great results from all major search engines, and many orders. All of a sudden 3 days ago, BANG everything returned a 404 error page, and the only way I could get my site operational was to completely remove ultimate seo from the code. Every time I tried to re-add it to application_top, my site went haywire again.

 

Bobby tried with me last night to see what the problem was, and between us we were completely stumped. By careful tweaking, I now have (nearly) all the code into my application_top file, and my site still works. The bit which breaks my site every single time i add it in is this line of code:

 

	$cache->get_cache('GLOBAL');

Does anybody have any idea

1) why this causes my site to return a 404 error (which btw is not my servers 404 page but a generic 404 error page...?)

2) why all of a sudden on sunday evening this line decided to cause problems, bearing in mind that I am the only person with access to my server, and I was tucked up in bed...?

 

Anyway, another little glitch I have noticed which may or may not be related is this - when I turn on ultimate SEO's in my control panel, it is nearly impossible to login and order anything on my site as every page returns a brand new session_id - you can log in, look at an item, when you go to add it to basket, the site wants you to login. Now login, the site has forgotten why you wanted to login to begin with! Sure fire way to frustrate customers!! The second you set ultimate seo to off, the sessions remain static and customers can order....

 

Is this all part and parcel of the same issue, and if so what??? I know it is infuriating having large httpd.conf files posted on the forums, so anybody who is interested can pick mine up by instant messaging me - the msn im address is on my member card, or send me a private message through the forum.... :thumbsup:

 

 

I haven't logged in to your server, but I can tell yo that you have some issues that are not SEO URL's . I just hit your site and the SID is in all URL's and you are not running SEO URL's right now. This is most likely a cookie issue.

 

You also have some wierd action in your footer.

 

Sounds like you issue is more the server. Might want to contact the server admin.

 

I know this does not help your problem, but you issue is not seo url's ...

 

Might want to look in to what is on your server that self updates if it just stopped working.

 

Chris


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

I have cookies disabled on my site as it was causing problems with so many customers and search engines - is there a work around for this that prevents the sid showing all the time?!

 

Whats the weird action in the footer? If you mean all my categories showing up, thats a very deliberate seo technique. If not, what do you mean?

 

Will look into what updates automatically on my server - good thinking batman!

 

Bobby - I have checked my httpd.conf file against about 6 others that are on various forums around osc, but i cannot see anything in there which would cause this problem; I'm pretty sure the problem is in there too, I just cant figure where.....where can I post or email the contents of the https.conf for people to peruse - if you think the one at the top of this page is long, you aint seen nothing yet!! lol!


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites
I have cookies disabled on my site as it was causing problems with so many customers and search engines - is there a work around for this that prevents the sid showing all the time?!

 

Whats the weird action in the footer? If you mean all my categories showing up, thats a very deliberate seo technique. If not, what do you mean?

 

Will look into what updates automatically on my server - good thinking batman!

 

Bobby - I have checked my httpd.conf file against about 6 others that are on various forums around osc, but i cannot see anything in there which would cause this problem; I'm pretty sure the problem is in there too, I just cant figure where.....where can I post or email the contents of the https.conf for people to peruse - if you think the one at the top of this page is long, you aint seen nothing yet!! lol!

 

 

OK... first yes if your store is configured properly for most clients sid's will only show for on click.

 

2... yes there a re bunch of categories links... I figured that was the ols SEO tactic (shich I believe google frowns upon now)...but was refering to the wierd javscript or something that was there ... I didnt look at the code to see what it was.

 

C-


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Chemo,

 

couple questions.

 

I tried upgrading to 1.4 so I could upgrade to 2.0 and my site died on me (blank pages all around), so I went back to 1.3. Was too tired to try to fix it so just went back to the older version.

 

My question is this, does storing the cache in your DB help performance? Would using the flat files slow the site down more than using the DB? Is there anything else in 2.0 that would make it worth it to upgrade to it besides the storing the cache in the DB?

 

Also, if I wanted to make the articles work with this mod, how many articles would be "too many" for the mod? If I had 1,000 articles would it just not be worth it slowness/server load wise?

 

Thanks for all your help, I really appreciate it. This mod is one of my favorites.

Share this post


Link to post
Share on other sites

Bobby Great contribution, I followed instructions as per contribution, but I'm getting this error message on my pages,

"Fatal error: Call to undefined function: tep_template_image_button() in /home/cubeappl/public_html/includes/modules/product_listing.php on line 133"

please advise, cheers

Share this post


Link to post
Share on other sites

Bobby, can you write a script so the articles manager functions with the SEO URL like it does with the products script you wrote.

 

Instead of:

/article_info.php?articles_id=1

 

It would be:

/crystal-chandeliers-p-1.html or something like that.

 

I know I have read where search engines don't care about the URL but I have seen a night and day difference with the products mod you wrote. I am finally getting google to index and cache my products pages. However, google is not caching my articles pages and I know this mod would do the trick if you could develop it. As I stated before I will be more than happy to pay to get it done. I tried emailing you but did not get a response so I am not sure it went through??

 

Thank You!!

Share this post


Link to post
Share on other sites

How can i do a PermanentRedirect for one of the ultimate SEO urls. When i do the command, and then click on the old link in google, the new page comes up, but with additional product and category numbers appended on the end of the url..

 

Suggestions, chemo?

Share this post


Link to post
Share on other sites

 

Thanks for the URL. However, I installed it word for word and I am getting the following error. Any suggestions?

 

Call to undefined function: tep_get_parent_topics() in /home/httpd/vhosts/builders-lighting-hardware.com/httpdocs/includes/seo_cache.php on line 273

Share this post


Link to post
Share on other sites

I installed this with no problems a couple of months ago. I just noticed that all the new categories I have added since then are generating URLs the old way, rather than having the word the URL. Any idea what would cause this.

Share this post


Link to post
Share on other sites
I installed this with no problems a couple of months ago. I just noticed that all the new categories I have added since then are generating URLs the old way, rather than having the word the URL. Any idea what would cause this.

 

I noticed the same thing. What I did was go to the SEO URLS ADMIN and reset the cache. This fixes the problem from what I can see. HOWEVER, now my Products URL's are back to the old way. I uninstalled the articles manager SEO and then reinstalled it again and everything works fine. HOWEVER, once I add a product or new article the URL's are the old way on the new ones added. If I reset the cache it fixes the articles URL but once again it puts ALL the products back to the old urls again and back I go again to the uninstall and reinstall of the Articles SEO. Works great as long as you don't add anything. Looks like these two modules are clashing with one another. BOBBY, we need your 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

×