× Here you can get community support related to ReDJ.

Redirect removed pages to previous directory

  • albert8675
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 1 month ago #1636 by albert8675
Is there any way to redirect removed pages to previous directory, like:

From: /any-path/any-cat/any-subcat/removed-doc
To: /any-path/any-cat/any-subcat/

From: /any-path/any-cat/removed-doc
To: /any-path/any-cat/

From: /{no-matter-the-directory-structure-is}/{all-404-pages}
To: /{no-matter-the-directory-structure-is}/

So that the rule doesn't care how many levels before the removed document but however not affecting documents that do exist?

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

More
11 years 1 month ago #1637 by admin
Hi,
it is possible to build a rule that matches a single "literal" URL. But it should be better to build a single rule that matches ALL the URLs to redirect. To do this, you need to find a common "pattern" among these. Can you tell me which values can assume the /removed-doc part?

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

  • albert8675
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 1 month ago - 11 years 1 month ago #1638 by albert8675
Replied by albert8675 on topic Redirect removed pages to previous directory
Thanks for the reply.

The /removed-doc really doesn't have a pattern... it is like /this-week-promotion, /buy-3-get-1-free, kind of non-permanent document... So when the promotion is ended, or the product is discontinued, they will be unpublished and I would like to see the page returns to the previous directory, which is a category blog showing all products actually.

I think the only common pattern for them is they will return 404 error code...
Last edit: 11 years 1 month ago by albert8675.

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

More
11 years 1 month ago #1641 by admin
...as I thought...

Unfortunately there's no way to build a rule like this in the current version. In the next version I would like to add a feature to support this like conditional redirection or redirection on error pages. But for now the only solution is to build a rule for each URL, and this is a very bad solution.

If you have a lot of error pages (I mean a thousand of old URLs or more) you could be a good "cavy" for my new extension (not released yet), that allows to redirect error pages automatically to the most similar existing page. If you are interested, send me an email at info(at)selfget.com.

Kind regards,
Luigi

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

Time to create page: 0.127 seconds