Jump to content
Latest News: (loading..)
spidometrs

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

Recommended Posts

As mentioned, I don't know what you changed but it doesn't appear you changed anything for product/article or category so I would expect them to still work.

Share this post


Link to post
Share on other sites

With my latest fix, there is a bug when you add a product with attributes -> go to basket page -> go back to the same product page -> leave the page => error 404 comes

To avoid 404 errors, we finally need to keep the original sentence for the 3 first lines :

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-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-by-([0-9]+).html$ all-products.php?fl=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-([0-9]+).html$ #article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-au-([0-9]+).html$ articles.php?authors_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-f-([0-9]+).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fri-([0-9]+).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fra-([0-9]+).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-([0-9]+).html$ links.php?lPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-n-([0-9]+).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nri-([0-9]+).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nra-([0-9]+).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}
# End Ultimate SEO V2.2d

As mentioned, I don't know what you changed but it doesn't appear you changed anything for product/article or category so I would expect them to still work.

 

Here are the changes :

 

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-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-by-([0-9]+).html$ all-products.php?fl=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-([0-9]+).html$ #article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-au-([0-9]+).html$ articles.php?authors_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-f-([0-9]+).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fri-([0-9]+).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fra-([0-9]+).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-([0-9]+).html$ links.php?lPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-n-([0-9]+).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING} <- fix the bug for newsdesk-info article name
RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nri-([0-9]+).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nra-([0-9]+).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}
# End Ultimate SEO V2.2d

Edited by milerwan

Osc v2.3.4 BS "custom"

Share this post


Link to post
Share on other sites

Hi,

Thanks this addon works beautifully-

I use urlencode(....) in front of my product_id for the actions and links on shopping_cart.php to lead perfectly as my host does not support curly brackets...

 

But the product with attribute URLS seem to redirect to index.php; Please Can you guide me of the fix detail and code that to deal with this hence I could get this working...

 

EXample the url now looks like this in Inspect element:-

http.........................-dress-p-3574%7B2%7D14%7B1%7D17%7B38%7D250%7B43%7D343%7B36%7D241%7B50%7D430%7B51%7D450.html

 

Awaiting your earliest reply

Thanks in advance;

Regds/

Radhavallabh

Edited by radhavallabh

Share this post


Link to post
Share on other sites

If you turn off this addon do the urls work correctly?

Share this post


Link to post
Share on other sites

You will probably need to add the urlencode to the returned url in the html_output file. Fixing code to work for a specific host is usually not a good idea since you may install some addon next weeks that also has to be changed. It's time to look for a new host, in my opinion.

Share this post


Link to post
Share on other sites

@@Jack_mcs

Yes when I switch off the addon the links start working perfectly......

 

I think from your posts elsewhere that you (also) mean:

....../sparkle-curves-deity-metal-earrings-p-3014%7B2%7D15.html

doesn't work, but

....../products_info.php?products_id=3014%7B2%7D15

does.

 

If so, I would infer trouble with the rule in your .htaccess file or with the way the query string substitution works.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hi,

Thank you for your valued response

@@Jack_mcs

Please could you elaborate on how and where to add the urlencode in the html_output file.... It will be of great help. As Changing the host currently will not be possible for me.

 

@@BrockleyJohn

Yes that is what I am trying to imply.... IS it the rules added for SEO addon that may be conflicting with the querystring substitution or Can the query string subtitution be taken care of in a way that it remains compatible with the SEO addon.

I have this in my htaccess

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 ^(.*)-by-(.*).html$ all-products.php?fl=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-au-(.*).html$ articles.php?authors_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 ^(.*)-f-(.*).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fri-(.*).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fra-(.*).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-n-(.*).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nri-(.*).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nra-(.*).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}

THanks again for helping & guiding me through this... Hope I get this working soon.

 

Regds/

Radhavallabh

Edited by radhavallabh

Share this post


Link to post
Share on other sites

@@radhavallabh perhaps you are getting your urls double-encoded. Try

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

The No Escape parameter should prevent that


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

I used that code still it is returnurning the same issue the product URL is redirecting to the index.php  :( ...

 

if you put

<?php
  var_dump($_REQUEST);
  exit();
?>

at the top of product_info.php and then put the SEO url in your browser

[catalog...]/blah-p-3014%7B2%7D15.html

what output do you get?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

and with the non-SEO url?

[catalog...]/products_info.php?products_id=3014%7B2%7D15

For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

 

I get this

array(1) { ["products_id"]=> string(44) "3573{2}14{38}250{43}337{36}241{50}430{51}450" }

 

URL was http:............product_info.php?products_id=3573{2}14{38}250{43}337{36}241{50}430{51}450

Edited by radhavallabh

Share this post


Link to post
Share on other sites

one final one, if you revert your .htaccess to the one without [NE] and use the SEO URL?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

I get

array(0) { }

 

ok - they're not double-encoded. In that case they probably need escaping after the rewrite. Try

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

B is for escape backreferences


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

Wow it seems it has almost reached to a fix ... (w00t)

 

I tested this URL

http://............dress-p-3573%7B2%7D15%7B38%7D250%7B43%7D343%7B36%7D327%7B50%7D430%7B51%7D450.html

 

The Dump gives below

array(1) { ["products_id"]=> string(44) "3573{2}15{38}250{43}343{36}327{50}430{51}450" }

 

And on click The URL now redirects to...... The Product's page without the attributes

 

http://..........dress-p-3573.html      :thumbsup:

 

I am almost jumping with joy mid way..... Thank you so much..... For helping me to get this far atleast............

:D

Share this post


Link to post
Share on other sites

@@BrockleyJohn

I just tested 

With SEO urls off the URL returns with the attributes selected on the product page.....

 

But with SEO URLs on it is redirecting to the product page without the attributes....

Edited by radhavallabh

Share this post


Link to post
Share on other sites

@@BrockleyJohn

I just tested 

With SEO urls off the URL returns with the attributes selected on the product page.....

 

But with SEO URLs on it is redirecting to the product page without the attributes....

 

I just tried it out on a test system for a customer with this addon but who doesn't use attributes. It looks like what you're experiencing is the default behaviour of the addon - you get the same as a site without the curly braces issue. I dare say it's fixable, but will take a little looking into.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

 

Yes I did notice even when I did not use 'urlencode' and the fix ....the products without the attributes redirected to there respective urls perfectly... But products those with attributes redirected to index.php....

 

But now

after using urlencode and your fix....

The products without attributes redirect the same way too and those with attributes are redirecting to the same base urls like the without ones.

Share this post


Link to post
Share on other sites

@@radhavallabh go into the SEO settings in admin and set 'Enable automatic redirects?' to false

 

Incidentally, I suspect you could have played with these settings and maybe the special character conversion to avoid making any changes to the code.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

 

(w00t) :thumbsup: :thumbsup: :thumbsup: :D

It is now working like a charm .... No problems at all...... I am so happy Thank you soooo much for helping me finally fix this issue.

I am so grateful just cant express my gratitude enough.

 

Sorry but I may trouble you with One more thing how can I make all the links in shopping cart.php to work as SSL on refresh...

.That is the product link, Remove button, and the Quantity Update button

All refresh the cart to the HTTP version on updating it thereby showing a warning of transferring to a insecure enviroment.

 

Thanks again....

Regards/

Radhavallabh :) :)

Share this post


Link to post
Share on other sites

@@BrockleyJohn

I use this button for updating quantity how can I add SSL to it so that the warning does not show.....

<div class="shopping_cart_refresh">'. tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . '</div>
Edited by radhavallabh

Share this post


Link to post
Share on other sites

 

@@BrockleyJohn

I use this button for updating quantity how can I add SSL to it so that the warning does not show.....

<div class="shopping_cart_refresh">'. tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . '</div>

 

The problem isn't the button, it's the action on your form - and it's also not related to this addon; you should really create a separate thread for more help with sorting out your cart SSL. However, since I'm already answering it, you should be able to force SSL on the form action in shopping_cart.php with

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product', 'SSL')); ?>

For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

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

×