Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

Thank you Jack_mcs ;)

i try it on a fresh install Phoenix Edition v1.0.5.0

i follow the "Install instructions for Ultimate SEO into a Phoenix shop"

i have a right rewriting url : "phoenixorg/tomatoes-p-5.html"

but i have a white page error 404 on products, category and manufacturers

my htaccess :

	# $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
	<IfModule mod_headers.c>
  Header unset ETag
</IfModule>
FileETag None
	## EXPIRES CACHING ##
## https://gtmetrix.com/leverage-browser-caching.html ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING ##
	# 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 /phoenixorg/
	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
	

Can you tell me if i do something wrong or if i forgot something.

Thank you

 

Link to comment
Share on other sites

3 minutes ago, hugo_064 said:

i have a right rewriting url : "phoenixorg/tomatoes-p-5.html"

This shows the code in this addon is working. I'm assuming you tried clicking around the shop prior to the installation but if you didn't, go to admin->Configuration->SEO URLs and turn it off. Then try loading the page to make sure it works. If you know the page loads without this addon enabled, then my guess is that you need to enable the mod_rewrite in your xampp setup.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thank you jack for information

i turn off the addon and site work fine.

url  of tomato : "phoenixorg/product_info.php?products_id=5"

and real product page

After verification the xamp mod_rewrite is enable.

i reset seo cache and turn on the addon but same result

url : "phoenixorg/tomatoes-p-5.html"

white page and error 404

i don't know what to do...

thank you

 

Link to comment
Share on other sites

Ok it's good ;)

i found the solution in the standard install

404 Error
This is the most common problem and is almost always due to having the path set incorrectly in the .htaccess file. To see if this is the problem, go to your site. If it has a url like http://some_domain.com/, then your shop is located in the root of your account. If it has a url like http://some_domain.com/another_name/, then your shop is located in the "another_name" sub-directory. Using this information, open your .htaccess file and find the line that reads

RewriteBase /

If your shop is located in the root directory, as determined with the above test, then the above line is correct. But if your shop is located in some other directory, then change the above line to

RewriteBase /another_name/

 

Thank you Jack for your time ;)

 

Link to comment
Share on other sites

  • 1 month later...
59 minutes ago, LeeFoster said:

Can the code be amended to change the formatting? Happy to look into it myself if it is possible.

I would say it is not possible because the product and category IDs are mandatory for it to work.

 

SEO URL5 can't do this neither. The only SEO URL AddOns which do this are as far as I know:

SEO-G
which is not updated and maintained any more and will not work with Phoenix

SEO Friendly Urls - a new approach
Which probably need some update or not. But the author still maintaines it.

Edited by raiwa
Link to comment
Share on other sites

A new version has been uploaded with these changes:

  • Added a hook for the application_top change so that that change is no longer needed (Phoenix only). Provided by @raiwa.
  • Removed all remaining definitions in the class file.

For any shop, to upgrade just upload the seo.class.php file. For Phoenix shops, if you want to use the new hook, you will need to remove the change for this addon in includes/application_top.php.

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

For Phoenix user, the following change is needed to prevent a warning. In includes/classes/seo.class.php, replace this code (at line 786)

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

with this

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

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

44 minutes ago, Owl Sauron said:

Hi there.

the "Enter special character conversions " option is not working at all for me on a Phoenix 1.0.5.0 shop . Anyone else with this problem?

 

Best regards,

It works for me.

I'm now on 1.0.6.0 and it has worked on all previous Phoenix versions.

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

found something else aswell on PHP7.2

Warning: Use of undefined constant SEARCH_ENGINE_FRIENDLY_URLS - assumed 'SEARCH_ENGINE_FRIENDLY_URLS' (this will throw an Error in a future version of PHP) in /home/naturhigia/public_html/loja/includes/classes/seo.class.php on line 786

Link to comment
Share on other sites

Hi Jack,

Noticed in my error logs the following:

Use of undefined constant CHARSET - assumed 'CHARSET' (this will throw an Error in a future version of PHP) in /xx/xx/xx/xx/includes/classes/seo.class.php on line 1824

which is :              

  if (CHARSET == 'utf-8') {
 

Link to comment
Share on other sites

I checked the logs of different sites, using different versions of oscommerce and php but I don't see that for any of them. CHARSET is defined in english.php, or whatever your language is. Maybe it is missing from your shop? 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

4 hours ago, Jack_mcs said:

I checked the logs of different sites, using different versions of oscommerce and php but I don't see that for any of them. CHARSET is defined in english.php, or whatever your language is. Maybe it is missing from your shop? 

It is defined in english.php and french.php so I do not understand. Using PHOENIX 1.0.5.0.

Link to comment
Share on other sites

13 hours ago, artfulweb said:

CHARSET

 

17 hours ago, Jack_mcs said:

CHARSET

I found the same in my logfiles:

error log:
PHP Warning:  Use of undefined constant CHARSET - assumed 'CHARSET'

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

This error was initiated by a bot / hacker with a couple of te next  urls :

access.log:
[06/May/2020:14:55:04 +0200] "GET /somebrand-m-429.html?ceid=kj1oe5oi9m948qfga4evf5dt2f&pHFd%3D8021%20AND%201%3D1%20UNION%20ALL%20SELECT%201%2CNULL%2C%27%3Cscript%3Ealert%28%22XSS%22%29%3C%2Fscript%3E%27%2Ctable_name%20FROM%20information_schema.tables%20WHERE%202%3E1--%2F%2A%2A%2F%3B%20EXEC%20xp_cmdshell%28%27cat%20..%2F..%2F..%2Fetc%2Fpasswd%27%29%23 HTTP/1.0" 200 9791 "-" "Opera/9.12 (Windows NT 5.0; U; ru)"

seems this url takes the system down and CHARSET cannot be found. ?

 

 

Link to comment
Share on other sites

4 hours ago, Rwe said:

access.log:
[06/May/2020:14:55:04 +0200] "GET /somebrand-m-429.html?ceid=kj1oe5oi9m948qfga4evf5dt2f&pHFd%3D8021%20AND%201%3D1%20UNION%20ALL%20SELECT%201%2CNULL%2C%27%3Cscript%3Ealert%28%22XSS%22%29%3C%2Fscript%3E%27%2Ctable_name%20FROM%20information_schema.tables%20WHERE%202%3E1--%2F%2A%2A%2F%3B%20EXEC%20xp_cmdshell%28%27cat%20..%2F..%2F..%2Fetc%2Fpasswd%27%29%23 HTTP/1.0" 200 9791 "-" "Opera/9.12 (Windows NT 5.0; U; ru)" 

This seems to me a hack-attempt ... Probably a script-kiddy bet maybe @Jack_mcs can explain better.

Link to comment
Share on other sites

20 hours ago, artfulweb said:

It is defined in english.php and french.php so I do not understand

Are you getting the notice in both languages? Are you using a new version of  this addon? It might be the last hook that was added. Try using the previous version. You will have to remove the hook file and add the code to the application_top file.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

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...