News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

SEF URL's puzzling me, not working

Started by kden, April 24, 2018, 14:41:04 PM

Previous topic - Next topic

kden

Like many others I have been having an issue with my SEF URL's in the product detail page. It's been a real puzzler. I've updated our website to a new template and the most current version recently and ever since, the URL's have been messy. I may be missing something super obvious but I cannot figure out why they aren't working right, when they used to be the clean version.

Example: https://www.sternmastermarine.com/component/virtuemart/service/large-outboard-service-stand-detail?Itemid=225
USED to look like this: http://www.sternmastermarine.com/product-catalog/service/large-outboard-service-stand-detail

The non viruemart pages work fine, the product-catalog page and the category pages look right, but not the individual products.

What I have done/tried:
-I've cleared the cache and history/restarted the browser multiple times.
-Virtuemart Configuration: 'SEO Disabled' is unchecked
-Global Configuration: Search Engine Friendly URL's = ON, Use URL Rewriting = ON
-I have rebuilt all the menu's (they did not change in the update so I do not imagine something is not set properly)
-The Main SHOP virtuemart page is the updated category layout (not the deprecated layout)
-I uploaded a fresh version of .htaccess when I moved our test updated site live but I will attach that code below in case I've done something there.


Joomla 3.8.7
Virtuemart 3.2.14
Template: Virtueplanet Smart

##
# @package    Joomla
# @copyright  Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.
# @license    GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
# It is required for the use of mod_rewrite, but it may have already been set by your
# server administrator in a way that disallows changing it in this .htaccess file.
# If using it causes your site to produce an error, comment it out (add # to the
# beginning of the line), reload your site in your browser and test your sef urls. If
# they work, then it has been set by your server administrator and you do not need to
# set it here.
##

## No directory listings
<IfModule autoindex>
  IndexIgnore *
</IfModule>

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## Mod_rewrite in use.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.sternmastermarine\.com)?$
RewriteRule (.*) http://www.sternmastermarine.com/$1 [L,R=301]

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment the following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

Studio 42

Hi check in your Virtuemart config SEO tab : select : Use full category tree for product links because i have myself some problem because no right item ID is set in some case.
And perhaps you are now forced to use Menu Item Type : Category Layout as root link in Joomla menu items and not the original shop home page anymore.
I hate to use myself this page, because you have now more work to know, if you display a product list or simply the root link(before it was very simple, you checked the "view"


Studio 42


kden

I am not sure how you are seeing service/service as the return url because I am only seeing service. I've got my menu's set up as SHOP (virtuemart category layout) and then all the product catgories below it are also virtuemart category layouts.

I'm not sure I am understanding if you are suggesting I keep checked or uncheck the full category tree for product links, as it has already been checked. I've attached images of both the menu setup and the seo tab to see if I am missing something.

Studio 42

Go to https://www.sternmastermarine.com/product-catalog/service/large-outboard-service-stand-detail
and check link Back to: Service Equipment & Stands
This link is "/product-catalog/service/service"
I dont know if this is from new Virtuemart release or Joomla, but it's bugged.
When i have item_id=ID on a link, it's when VIrtuemart not find the menu ID in your case Itemid=225
What is the menu item having ID 225 ?

kden

Very interesting, do you think somehow the service category is duplicated?

Menu item 225 is the Service Category menu item. Maybe I need to literally rebuild the entire menu/links?

kden

Since that issue has been brought up I've realized that all of the categories do that, but some of the product details link to the item=ID for the specific category it is in and some link to the item=ID for the main shop page. I'm assuming that when I had to update from the old front page style that used to be in virtuemart to the updated category layout for the main shop page, something doesn't translate. Not sure what to do. I don't really want to delete all the menu structure and rebuild it because I have no idea if that would even work, and 'rebuilding' the menu has had no change whatsoever. It seems like the links might work both ways but I want our customers to see the clean version, and as far as I can tell they are getting the messy.

Studio 42

perhaps the problem is in the template overides, you should compare Vm and template files about the product links.

kden

I got with support from our virtueplanet template already and he was very firm that in no way is that possibly a template issue.

Not really sure what my next step will be,  obviously it is not the end of the world but it does not look very professional and it means all our links from the last 4 years are possibly wrong now (although it seems like the correct sef url still gets you tot he right webpage)

kden

Thought I would post the solution here in case anybody else runs into this.

I have NO idea why this was the cure, at this point I don't really care as I am just happy it is working.

In our Menu > Shop > (Product Categories) I realized that the single working category did not have a Manufacturer selected, while all the other categories did have a manufacturer selected. Simple changing all the product categories to "Please Select" Instead of our single manufacturer was the solution to getting rid of the long messy URL.

So: Our Virtuemart >> Category Layout menu items all show "Please Select" next to Manufacturer in the Details Page. If I select the manufacturer virtuemart does not know how to handle the product page URL