× Here you can get community support related to ReDJ.

Redirect URL - Remove Date

  • joktanh
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 day ago #4790 by joktanh
Redirect URL - Remove Date was created by joktanh
Hello Luigi,
I would like to redirect

blog/xxx/yy/zz/alias/

to:

blog/alias.html

where "/xxx/yy/zz/" represents the date "/year/month/day/"

- xxxx: any four numbers that represents the year
- yy: any 2 numbers that represent the month
- zz: any 2 days that represent the day

I just bought the ReDJ Enterprise version.

Can you please help me.

Thank you very much and have a great day.

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

  • joktanh
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 day ago #4791 by joktanh
Replied by joktanh on topic Redirect URL - Remove Date
I forgot to specify that alias can be any string that could be in the alias field in joomla.

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

More
10 years 2 days ago #4793 by admin
Replied by admin on topic Redirect URL - Remove Date
Assuming that /blog/alias.html exists, try this rule:
From URL: ^/blog/[0-9]+/[0-9]+/[0-9]+/
To URL: {scheme}://{siteurl}/{preg_match 1}/\/blog\/[0-9]+\/[0-9]+\/[0-9]+\/([^\/]+)/{/preg_match}.html
Request only: true (checked)

Best regards,
Luigi

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

  • joktanh
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 day ago #4796 by joktanh
Replied by joktanh on topic Redirect URL - Remove Date
Hello Luigi,
Thank you for your quick reply!

I tried your code but unfortunately it doesn't work and I still get a 404 error.

Here are some examples:
from: blog/2015/04/30/top-2-womens-self-defense-questions-receive/
(current website: safeinternational.biz/blog/2015/04/30/top-2-womens-self-defense-questions-receive/ )
to: blog/top-2-womens-self-defense-questions-receive.html
(new temp website: www.ihotweb.com/safeinternational/blog/top-2-womens-self-defense-questions-receive.html)

- from: blog/2015/05/05/self-defense-pranks-go-far/
(current website: safeinternational.biz/blog/2015/05/05/self-defense-pranks-go-far/ )
- to: blog/self-defense-pranks-go-far.html
(new temp website: www.ihotweb.com/safeinternational/blog/self-defense-pranks-go-far.html)


You can test it here www.ihotweb.com/safeinternational/ which will become safeinternational.biz/ soon.

Please note that I am using EasyBlog for the blog.

Thank you very much for your help and have a great day.

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

More
10 years 1 day ago - 10 years 1 day ago #4799 by admin
Replied by admin on topic Redirect URL - Remove Date
Hi,
if I call:

safeinternational.biz/blog/2015/04/30/top-2-womens-self-defense-questions-receive/

It is not redirected while it should match the rule, but it seems you are currently testing on:

www.ihotweb.com/safeinternational/

The problem is the initial caret ? in the rule (means "start with"), as is the URL:

www.ihotweb.com/safeinternational/blog/2015/04/30/top-2-womens-self-defense-questions-receive/

Doesn't match. You should drop the caret, but a better solution to make rules "portable" is to add a base path in the ReDJ plugin. Under tab "Advanced settings" add this in the base path field:

/safeinternational

You must drop this once the site will be moved on root.

Kind regards,
Luigi
Last edit: 10 years 1 day ago by admin.

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

  • joktanh
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 day ago #4800 by joktanh
Replied by joktanh on topic Redirect URL - Remove Date
Hello Luigi,
It still doesn't work:(

I removed the caret as suggested from the "From URL". Thus my From URL now is: /blog/[0-9]+/[0-9]+/[0-9]+/

When I try
www.ihotweb.com/safeinternational/blog/2015/04/30/top-2-womens-self-defense-questions-receive/

I get

www.ihotweb.com/safeinternational/%7Bpreg_match%201%7D///blog//[0-9]+//[0-9]+//[0-9]+//([%5E//]+)/%7B/preg_match%7D.html

The URL should be:
www.ihotweb.com/safeinternational/blog/top-2-womens-self-defense-questions-receive.html

Is there anything else that I need to update?

Thank you very much!

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

Time to create page: 0.116 seconds