Remove URL portion

I have such a url http://example.com/blog/photos/photos/gallery/image/1.

And I need to delete the folder with two photos. How to remove a part using mod_rewriteand .htaccess?

For your interest / blog, my document root.

Thanks so much for any suggestions, Steve

EDIT

You should be aware that URLs are generated by Wordpress 3.0 and NextgenGallery.

http://example.com/blog- my document root. This means that I installed Wordpress in a folder blog.

The first failure after blogis the page that my gallery is linked to.

The second slug is the name of the album and can be renamed to whatever you want. This is just the place for my galleries. gallery- name of the gallery.

+3
source share
1 answer

Assuming you want to do a redirect:

RewriteRule ^/blog/photos/photos/(.*)$ /blog/photos/$1 [R]
+6
source

Source: https://habr.com/ru/post/1754498/


All Articles