Quantcast
Channel: Zenphoto forum
Viewing all articles
Browse latest Browse all 2917

Jole on "301 Rewrite role changing folder names and image page exension"

$
0
0

Hello.

A friend of mine has changed folder names (not title, but actual folder names) and mod_rewrite suffix from standard ".php" to ".html"
Original folder names had SAME "-gallery-suffix" at end of its name.

For example:

http://www.example-site-name.com/my-pets-gallery-suffix/dogs-gallery-suffix/
http://www.example-site-name.com/my-pets-gallery-suffix/dogs-gallery-suffix/image-name.jpg.php

Now it is without that "-gallery-suffix" and ".html" instead of ".php" like this:

http://www.example-site-name.com/my-pets/dogs/
http://www.example-site-name.com/my-pets/dogs/image-name.jpg.html

I need help with 301 redirection, I tried this:

#Image pages
RewriteRule ^-gallery-suffix(.*).jpg.php(.*)$ $1.jpg.html$2 [L,R=301]

# Folder pages
RewriteRule ^-gallery-suffix(.*)$ $1 [L,R=301]

It works great, for first folder level:

http://www.example-site-name.com/my-pets/
http://www.example-site-name.com/my-pets/image-name.jpg.html

But, for multi level galleries with sub-folders it just remove last "-gallery-suffix" and I get this:

http://www.example-site-name.com/my-pets-gallery-suffix/dogs/
http://www.example-site-name.com/my-pets-gallery-suffix/dogs/image-name.jpg.html

How to remove all instance of "-gallery-suffix" if more than one if URL?

Could you please fix my rewrite roles?

Best regards.


Viewing all articles
Browse latest Browse all 2917

Trending Articles