Help with removing a directory
-
Akuna
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 8
-
Thank you received: 0
-
-
10 years 8 months ago #2827
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 8 months ago #2830
by admin
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.
-
Akuna
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 8
-
Thank you received: 0
-
-
10 years 8 months ago #2834
by Akuna
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.138 seconds