Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Clean URLs - only show current directory in URL

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-02-2015, 07:43 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Clean URLs - only show current directory in URL

Hi,

I have URLS like this...

https://domain.com/products/applications/gas-meters/blue-gas-meters

I want...

https://domain.com/blue-gas-meters


I can't see a setting for this so I guess it's a re-write in the .htaccess?
__________________
Core version: 5.5.xx
Reply With Quote
  #2  
Old 04-03-2015, 05:02 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Clean URLs - only show current directory in URL

Current implementation is done with assumption that sub-categories can have the same name when placed in different categories, e.g. Toyota / Spare Parts and Mazda / Spare Parts.

That is why sub-categories have nested structure of their seo-friendly URLs. If you want to change it, you are welcome to order a customization from us. Receive a free quote at sales@x-cart.com and decide whether it is OK for you or not.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #3  
Old 04-04-2015, 09:11 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Clean URLs - only show current directory in URL

Quote:
Originally Posted by xgarb
Hi,

I have URLS like this...

https://domain.com/products/applications/gas-meters/blue-gas-meters

I want...

https://domain.com/blue-gas-meters


I can't see a setting for this so I guess it's a re-write in the .htaccess?

XC4 or XC5?
Reply With Quote
  #4  
Old 04-04-2015, 01:43 PM
 
kevinrm kevinrm is offline
 

X-Wizard
  
Join Date: Aug 2003
Posts: 1,003
 

Default Re: Clean URLs - only show current directory in URL

This is a MAJOR disadvantage of XC5 then, you automatically have loads of duplicate content if you put a product under more than one category, this will be penalized by Google. A lot of products fall under multiple categories - with XC5 you have to choose whether to be forced to restrict any product into one category, or have duplicate content.

I'm not sure why this was designed like this but it's not good.
__________________
X-Cart 5.4.1.39 Live
PHP 7.4.33
5.5.5-10.3.38-MariaDB MariaDB
Apache 2.4
CENTOS 7.8 64Bit Single Quad-Core E3-1241v3 3.4Ghz 8M 1600 w/ HT
32GB RAM 2x 512GB Samsung 850 Pro SSD RAID 1
Reply With Quote

The following user thanks kevinrm for this useful post:
Jon (04-04-2015)
  #5  
Old 04-07-2015, 06:34 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Clean URLs - only show current directory in URL

Quote:
Originally Posted by kevinrm
This is a MAJOR disadvantage of XC5 then, you automatically have loads of duplicate content if you put a product under more than one category, this will be penalized by Google. A lot of products fall under multiple categories - with XC5 you have to choose whether to be forced to restrict any product into one category, or have duplicate content.

I'm not sure why this was designed like this but it's not good.

Each of these "duplicated" pages points to a single canonical address and this will prevent you from being penalized by Google.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #6  
Old 04-07-2015, 06:48 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Clean URLs - only show current directory in URL

Modx (my favourite CMS) offers two options for the re-write..

Quote:
The Use Friendly Alias Path (use_alias_path) setting allows the site to display directory structures. If it is set to "No" all of the documents on the site will appear in the URLs as if they are directly off of the root, disregarding the paths. It the setting is set to "Yes" (the default), you will see a full path to the current page in the URLs.

I want everything off the root ie..

domain.com/mazda-spare-parts/
domain.com/toyota-spare-parts/
domain.com/toyota-oil-gasket.html

In Modx it checks the URL is unique

I'm not an expert but I imagine this approach is best for SEO and generally looks nicer.
__________________
Core version: 5.5.xx
Reply With Quote
  #7  
Old 04-08-2015, 11:41 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Clean URLs - only show current directory in URL

Thanks @xgarb for suggestion.
We are discussing improvements to SEO-friendly URLs here:
http://forum.x-cart.com/showthread.php?t=71767
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:53 AM.

   

 
X-Cart forums © 2001-2020