× Here you can get community support related to ReDJ.

how remove numbers in url

  • andr555
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 1 week ago - 8 years 1 week ago #5723 by andr555
how remove numbers in url was created by andr555
hi,

i have purchased Enterprise,

i have many article urls, something like this:
www.mydomain.com/blog/flash/943-my-article-number-3
i want to redirect it to
www.mydomain.com/blog/flash/my-article-number-3

but i have many such articles and urls ... how to redirect all of them with 1 redirect?
i want to remove from url that numbers on each article and want to redirect to new one, but without numbers like that 943-

my situation is that i have a lot of such urls, which i want to redirect with removing that number .. i guess it is article id 943- ... i want to remove on each url that article id and to redirect them without that article id,
is it possible?

in other words ... in such urls "www.mydomain.com/blog/flash/943-my-article-number-3" i want to catch such numbers 943- (it can be anything), to delete it from url and to redirect it to new urls, but without that numbers ...

those solutions -
selfget.com/forum/redj/1231-replacing-item-1234.html
selfget.com/forum/redj/1608-redirect-urls-with-trimed-numbers.html
dont works for me.

thank you
Last edit: 8 years 1 week ago by andr555.

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

More
8 years 1 week ago - 8 years 1 week ago #5724 by admin
Replied by admin on topic how remove numbers in url
Hi,
first I would like to be sure about your request. Please, read carefully...

The ID is required by Joomla to identify the item. We could build a rule to redirect an URL like:

www.mydomain.com/blog/flash/my-article-number-3

To an URL like:

www.mydomain.com/blog/flash/943-my-article-number-3

Using some macros to lookup the tables for the slug "my-article-number-3" and get the id "943". And the redirect could be "internal" so the URL in the address bar will not change.

But the problem is that Joomla itself will continue to generate URLs like this:

www.mydomain.com/blog/flash/943-my-article-number-3

And is not a ReDJ duty to change this, because ReDJ is a redirection extension and not a routing extension.

So if your problem is to get rid of any URL with the id, you should first "hack" the routing script for the extension, to drop the id part. After this probably you will need the ReDJ rule to add the ID information back again (because it is required by Joomla to work), if this is not already included in the routing hack.

Ler me know your thoughts...

Kind regards,
Luigi
Last edit: 8 years 1 week ago by admin.

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

  • andr555
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 1 week ago - 8 years 1 week ago #5727 by andr555
Replied by andr555 on topic how remove numbers in url
hi,

So if your problem is to get rid of any URL with the id, you should first "hack" the routing script for the extension, to drop the id part

yes, i understand, i use this hack - forum.joomla.org/viewtopic.php?t=712037#p3153262

so both urls has the same content:
www.mydomain.com/blog/flash/943-my-article-number-3
www.mydomain.com/blog/flash/my-article-number-3

and for fixing the duplicate content issue (google dont likes that... as i know) i just want to redirect all such urls:
www.mydomain.com/blog/flash/943-my-article-number-3
to
www.mydomain.com/blog/flash/my-article-number-3

i have many such articles .. and instead of redirecting each of them separately (i have more than 1000 articles ... i cant add 1000 separate redirects in adminside...), i want to redirect them with single redirect macro ...

thank you very much
Last edit: 8 years 1 week ago by andr555.

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

More
8 years 1 week ago #5728 by admin
Replied by admin on topic how remove numbers in url

and for fixing the duplicate content issue (google dont likes that... as i know) i just want to redirect all such urls:
www.mydomain.com/blog/flash/943-my-article-number-3
to
www.mydomain.com/blog/flash/my-article-number-3


Create a rule as follow literally:
From URL: ^/blog/flash/[0-9]+-
To URL: {scheme}://{siteurl}/blog/flash/{preg_match 1}/\/blog\/flash\/[0-9]+-([^\?]+)/i{/preg_match}{queryfull}
Request only: true (checked)

Not tested but it should work.... let me know.

Kind regards,
Luigi

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

  • andr555
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 1 week ago #5729 by andr555
Replied by andr555 on topic how remove numbers in url
thank you so much, works well!

Best Regards,
Andrey

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

More
8 years 1 week ago #5730 by admin
Replied by admin on topic how remove numbers in url
U're welcome, Andrey!!!

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

Time to create page: 0.253 seconds