Jump to content
spidometrs

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

Recommended Posts

A new version has been uploaded with these changes:

  • Changed code to fix a 7.3 compatibility problem.
  • Changed code to fix the character conversion option.
  • Split into a Phoenix and non-Phoenix versions. The former accomplished by files supplied by @raiwa.

Share this post


Link to post
Share on other sites

hi works like a charm. I was waiting for this. 

there is only one minor issue. when go from manufacturer to the product you lose the manufacturer. it is not in the link and not on the breadcrumbs it goes to category

is this normal behavior. 

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites

As far as this addon is concerned, yes, that is how it should work. As far as the basic shops code, I think it is normal. I can't recall ever seeing code where the manufacturer id was added to the url of a product, though I may be wrong.

Share this post


Link to post
Share on other sites
10 hours ago, Rosyweb said:

Enable Use Header Tags as name.

That Is for the Header Tags SEO addon which, I assume, you have not installed.

Share this post


Link to post
Share on other sites

I'm having problems getting this to work correctly on my live site. 

On my test site (where files are identical) all is fine.  

When I transfer it over to my live site - it just results in a blank page.   Basically when you look at code source it just has 1.    then nothing.  So the code is broke from the point where it's introduced into application_top. 

Copies over all files from test site - so identical.   The admin files and seo.class  and the file reset_seo_cache.php  copy over ok, i.e. do not break the site - although SEO URLs title is not appearing under configure in the admin side of the site.  

When I add it into application_top and includes/functions/html_output.php      then the code breaks.   

I'm on for both the test site and live - Bootstrap v2.3.4.1 CE    and php 7.1. 

.htaccess now looks like this:

 

------------------------------------------------------------------------------------------

#.htaccess ros

#Redirect 301 mysite.co.uk http://www.mysite.co.uk

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{HTTPS} !on [NC]
 RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.co.uk$ [NC]
RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [R=301,L]

ErrorDocument 404 /404.shtml


#rewrite
#RewriteEngine On   (enables the rewrite engine)
#RewriteCond %{HTTP_HOST} ^http://mysite.co.uk [NC,OR]
#RewriteCond %{HTTP_HOST} ^mysite.co.uk [NC]  
#RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [L,R=301,NC]  (send the redirect to this)


<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 65.19.141.114

------------------------------------------------------------------------------------------

Any ideas where else I can look for a reason why the same files uploaded to my live site that do work on my test site, don't work on the live site??   What other settings should I check?

many thanks!

 

Share this post


Link to post
Share on other sites

Sorry - .htaccess actually looks like this:

#.htaccess ros

#Redirect 301 mysite.co.uk http://www.mysite.co.uk

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{HTTPS} !on [NC]
 RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.co.uk$ [NC]
RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [R=301,L]

ErrorDocument 404 /404.shtml


#rewrite
#RewriteEngine On   (enables the rewrite engine)
#RewriteCond %{HTTP_HOST} ^http://mysite.co.uk [NC,OR]
#RewriteCond %{HTTP_HOST} ^mysite.co.uk [NC]  
#RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [L,R=301,NC]  (send the redirect to this)


<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 65.19.141.114

 

 

# Begin Ultimate SEO V2.2d
Options +FollowSymLinks
RewriteEngine On

  # RewriteBase instructions
  # Change RewriteBase dependent on how your shop is accessed as below.
  # http://www.mysite.com = RewriteBase /
  # http://www.mysite.com/catalog/ = RewriteBase /catalog/  
  # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

  # Change the following line using the instructions above  
 
#RewriteBase /YOU HAVE TO CHANGE ME/   changed - see below

RewriteBase /test2/

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}
# End Ultimate SEO V2.2d

Share this post


Link to post
Share on other sites

@RosywebI suggest changing your .htaccess file to what I show below. But before you do that, for the live server, remove all of the entries for this addon and see if your site will load. If it doesn't, then the problem is either in the application_top or html_output file changes. Those have not changed for many years for the most part so it is unlikely the code itself is at fault. You may have copied something wrong, like missing a closing bracket or something like that.

 

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTPS} !on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^mysite\.co.uk$ [NC]
RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [R=301,L] 

ErrorDocument 404 /404.shtml 

 <Files 403.shtml>
 order allow,deny
 allow from all
 </Files> 

deny from 65.19.141.114 
  

# Begin Ultimate SEO V2.2d
RewriteBase /test2/ 

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}
 # End Ultimate SEO V2.2d 

 

Share this post


Link to post
Share on other sites

Thank you Jack.  

Unfortunately it didn't work. 

I'm now using the .htaccess as above.  The site all works fine when I take off the add ins. 

 

Works fine in fact when I add everything back in from SEO URL's contribution until 

application_top
and
includes/functions/html_output.php 

are put back in.  I'm using the exact same files for these that work on my test site.   When these go back in the code simply breaks.  

Could something server side be affecting this?   

Or is the clue in, that before I add  back to application_top and html_output.php  the site works with the admin additions put in, but the link to SEO URL is not appearing under configure.  

Although I have checked and checked the files in the admin folder:

includes/classes/seo.class.php
admin/includes/reset_seo_cache.php

both uploaded correctly.

admin/categories.php
admin/includes/functions/general.php

both identical to the ones working on my test site. 

Anything else to check that may not be compatible with the new code?

 

 

Share this post


Link to post
Share on other sites
2 hours ago, Rosyweb said:

Anything else to check that may not be compatible with the new code?

Be sure that you are uploading the files from the Not_Phoenix directory. Also, is SEO URLs now showing in the admin->Configuration section? If so, try turning the top setting off and then upload the files to see if it still fails. If none of that helps, try uploading the files in the previous version of this addon (_18).

Share this post


Link to post
Share on other sites

Thank you Jack.  I'd  inadvertently uploaded the 2 upload files

includes/classes/seo.class.php
admin/includes/reset_seo_cache.php

from the wrong folder - onto my live site.  Everything else was correct!     It works now - Yipee!  

thanks for all your help!

Share this post


Link to post
Share on other sites

Sounds like a mistake I would make. :) Glad to hear you got it going.

Share this post


Link to post
Share on other sites
On 3/7/2020 at 8:04 AM, Jack_mcs said:

Sounds like a mistake I would make. :) Glad to hear you got it going.

Hi dear the addon has got incompatible with 1.0.5.3 now...

Please help with a update fix..

Thank you in advance;

Regds./

radhavallabh

Share this post


Link to post
Share on other sites
3 hours ago, radhavallabh said:

Hi dear the addon has got incompatible with 1.0.5.3 now...

In includes/classes/seo.class.php find Line 779

    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
      $link = str_replace('?', '/', $link);
      $link = str_replace('&', '/', $link);
      $link = str_replace('=', '/', $link);
      $separator = '?';
    }

Change to

// BOF Removal of SEFURLs
/*    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
      $link = str_replace('?', '/', $link);
      $link = str_replace('&', '/', $link);
      $link = str_replace('=', '/', $link);
      $separator = '?';
    } */
// EOF Removal of SEFURLs 

Works for me.


Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.7.1) here.

Share this post


Link to post
Share on other sites
45 minutes ago, mhsuffolk said:

In includes/classes/seo.class.php find Line 779


    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
      $link = str_replace('?', '/', $link);
      $link = str_replace('&', '/', $link);
      $link = str_replace('=', '/', $link);
      $separator = '?';
    }

Change to


// BOF Removal of SEFURLs
/*    if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
      while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
      $link = str_replace('?', '/', $link);
      $link = str_replace('&', '/', $link);
      $link = str_replace('=', '/', $link);
      $separator = '?';
    } */
// EOF Removal of SEFURLs 

Works for me.

Kudos!!

Awesome it works dear.. Thank you so much :)

Share this post


Link to post
Share on other sites

I'm sorry, I'm having another problem with this now.  

On my live site, when Enable SEO URLs is on, when you navigate to anywhere via the navigation, we're getting:

Quote

 

The page isn’t redirecting properly

An error occurred during a connection to www.mysite.co.uk.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

 

If I just link straight to a product from the home page, i.e. a special - all is ok.    When I turn  Enable SEO URLs  to false - all is fine again navigating the site.

 

Any idea where I can look, or what I can set to get rid of this?  

It's Bootstrap v2.3.4.1 CE   Php 7.1

thanks!

   

Share this post


Link to post
Share on other sites

Your previous reply said it was working. Is it that you didn't notice this problem or was it working and now doesn't?  One thing you can try is turn off all of the settings except for the first one to see if that helps.

Share this post


Link to post
Share on other sites

I think it was working fine, well I hadn't seen any problems.   Then someone told me about the problem today, they found from a different computer and they were right it was doing this also on my pc.  

I've just fiddled with the settings - tried to change Reset SEO URLs Cache to Reset,  but it keeps defaulting back to false.   Then looked again at the live site and the problem seems to have disappeared for now??!!       Not sure if this cleared some cache and if the problem will return again later - but its working again for now.    I'll keep an eye on it.

Share this post


Link to post
Share on other sites
38 minutes ago, Rosyweb said:

but it keeps defaulting back to false

That's how it is supposed to work. When you set it to true, it runs the code to clear the cache and then resets the setting to false. So it sounds like clearing cache took care of the problem.

Share this post


Link to post
Share on other sites

OK, that makes sense.  So should I perhaps not enable i.e. categories cache - to stop it building up the cache stored?  If this created a problem?

Share this post


Link to post
Share on other sites

There shouldn't be a problem using the cache options. I think the problem may have been caused by the previous mistakes you had.  Keep an eye on it and if happens again you can turn the cache options off.

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

×