Redirect URL site/cat/item
-
radisnoir
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 5
-
Thank you received: 0
-
-
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 2 months ago #2033
by admin
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
-
Less
More
-
Posts: 5
-
Thank you received: 0
-
-
11 years 2 months ago #2034
by radisnoir
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 2 months ago #2035
by admin
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.152 seconds