Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove part of URL

i have a url like this http://example.com/blog/photos/photos/gallery/image/1.

And i need to remove the second photos folder. How do i remove the part using mod_rewrite and .htaccess?

For your interest /blog is my document root.

Thanks a lot for any suggestions, Steve

EDIT

You should know that the URLs being generated by Wordpress 3.0 und NextgenGallery.

http://example.com/blog is my document root. That means i have installed Wordpress into the folder blog.

The first slug after blog is the page i have my gallery associated with.

The second slug is the name of the album and could be renamed to everything you want. It is just a placeholder for my galleries. gallery is the name of the gallery.

like image 611
gearsdigital Avatar asked Dec 05 '25 07:12

gearsdigital


1 Answers

Assuming you want to do a redirect:

RewriteRule ^/blog/photos/photos/(.*)$ /blog/photos/$1 [R]
like image 139
Taylor Leese Avatar answered Dec 07 '25 22:12

Taylor Leese