Jump to content

[SOLVED] Clean URLs for Sub-Category Pages Without Parent Category?


ASP

Recommended Posts

I have the Clean URLs module working perfectly, however, is it possible to have the category URL path consist of only the sub-category without the parent category path?
 

I sell officially licensed merchandise and have created the following category menu structure:

 

Designs > Officially Licensed > Band Name

 

Which creates this URL:

domain.com/designs/officially-licensed/band-name/

 

For the band's merchandise page I need this to be the URL:

domain.com/band-name

 

What is the best way to achieve this? Any help or suggestions would be greatly appreciated,

Edited by ASP (see edit history)
Link to comment
Share on other sites

  • 5 weeks later...

Copy files from this post #54 , edit override/classes/Dispatcher.php 

'category_rule' => array(
			'controller' =>	'category',
			'rule' =>		'{category:/}{rewrite}/',
			'keywords' => array(
				'id' =>				array('regexp' => '[0-9]+'),
				'category' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'categories' =>		array('regexp' => '[/_a-zA-Z0-9-\pL]*'),
				'rewrite' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'category_rewrite'),
				'meta_keywords' =>	array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'meta_title' =>		array('regexp' => '[_a-zA-Z0-9-\pL]*'),
				'parent_categories' =>		array('regexp' => '[/_a-zA-Z0-9-\pL]*'),
				),
			
		), 
and then change fields in SEO&url to "category".

 

 

This solved my problem!  :D

Link to comment
Share on other sites

  • 3 weeks later...

After install the clean url module, all id was remove at the url. Another problem appear, all my category page and sub category page got error. I cannot see any product from the category page. Anyone can help me fix it?

 

How to remove category and sub category on the url? I want to change url from http://shoppingononline.com/Wedding-Dresses/Wedding-Gowns/red-wedding-gown-ruffle-backless.html to http://shoppingononline.com/red-wedding-gown-ruffle-backless.html?

post-852368-0-99300500-1413018317_thumb.jpg

Link to comment
Share on other sites

×
×
  • Create New...