× Here you can get community support related to ReDJ.

Redirect URL site/cat/item

  • radisnoir
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #2032 by radisnoir
Redirect URL site/cat/item was created by radisnoir
I have a probleme with some URL redirection, this is my problem :

mywebsite.com/123-category-name
Redirection to
mywebsite.com/category-name

I need that the the destination visible URL will be without the Cat ID "123"

After that, I have to redirect all items of this category

mywebsite.com/123-category-name/365-title-of-article
Redirection to
mywebsite.com/category-name/365-title-of-article

And here too, I need that the the destination visible URL will be without the Cat ID "123"

It's very simple in appearance, but I'am trying since 3 days without result !

can you please help ?

Best regards

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #2033 by admin
Replied by admin on topic Redirect URL site/cat/item
Hi,
I guess that the URL mywebsite.com/123-category-name/365-title-of-article is the existing one, while the URL mywebsite.com/category-name/365-title-of-article is what you would like to get. If so, what you need is to redirect:

From URL: mywebsite.com/category-name/365-title-of-article
To URL: mywebsite.com/123-category-name/365-title-of-article

And not the opposite. Another thing to consider is that Joomla needs 123 for routing, so you could lookup 123 from the database using macros. The only thing that is not clear to me is how you would like to match ONLY categories. If you have also URLs like:

mywebsite.com/menu_1
mywebsite.com/menu_2
...
mywebsite.com/menu_N

There's no way to build a regular expression that matches only categories but not menus. So you should create a rule for each category.

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • radisnoir
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #2034 by radisnoir
Replied by radisnoir on topic Redirect URL site/cat/item
Hi Liugi, and many thanks for your reply

You are right, I have to create rule for each category.
The probleme is that I has 4 applications, builded with SEBLOD CCK, and those applications makes many problem with the URLs, so thats why I have to make that.

Anyway, i can not make exactly what you are proposing :

From URL: mywebsite.com/category-name/365-title-of-article
To URL: mywebsite.com/123-category-name/365-title-of-article

because there is many articles, (many hundred)
Don't you have a solution that let me rewite only the category

So it will look like this

From URL: mywebsite.com/category-name/[ID]-[article-name]
To URL: mywebsite.com/123-category-name/[ID]-[article-name]

Many thanks again
your help is precious

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #2035 by admin
Replied by admin on topic Redirect URL site/cat/item
Of course yes. The rule should be:
From URL: ^/category-name/.+
To URL: http://{siteurl}/${catid}-{path}{queryfull}
Request only: true (checked)

The only problem now is to build the placeholder ${catid}. You should extract "category-name", assign to a placeholder, and lookup the table to get the id. I could help you but I need the category table (you can send at info(at)selfget.com).

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.170 seconds