× Here you can get community support related to ReDJ.

Help with removing a directory

More
9 years 8 months ago #2827 by Akuna
Help with removing a directory was created by Akuna
I basically need to remove a subdirectory from a path:

For example:
https://my_website/images/phocagallery/000_new_site/rest/of/the/path/
should become:
https://my_website/images/phocagallery/rest/of/the/path/

I tried (among other things...)
From
^/images/phocagallery/000_new_site$
To
{siteurl}/images/phocagallery

But no redirection is taking place. What am I missing? (I did clear my browser's cache)

Other redirections not involving regex work just fine, for example simply changing an old picture name by the new one (so long as there are no change in directory structure).

What I want to do is first a rule to change the directory structure, and then a rule to change the file name (not all files changed).

So far the picture' name is redirected correctly when there are no directory changes. Now I need to figure out how to correct directory structure.

Thanks for your guidance.

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

More
9 years 8 months ago #2830 by admin
Replied by admin on topic Help with removing a directory
Hi,
try this:
From URL: ^/images/phocagallery/000_new_site/
To URL: http://{siteurl}/images/phocagallery/{pathltrim /images/phocagallery/000_new_site/}{queryfull}
Request only: true (checked)

Kind regards,
Luigi
The following user(s) said Thank You: Akuna

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

More
9 years 8 months ago #2834 by Akuna
Replied by Akuna on topic Help with removing a directory
Works perfectly.
Thank you very much for taking the time to give this specific answer, it helps me understand better the macros used in it.

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

More
9 years 8 months ago #2837 by admin
Replied by admin on topic Help with removing a directory
U're welcome.

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

Time to create page: 0.100 seconds