Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using nextgen gallery plugin in my blog. The default folder for storing images is wp-content/gallery/gallery_name/ . I'm looking for a way to move all images in all galleries to one folder.

Specifically, i want htaccess to rewrite all wp-content/gallery/gallery_name/filename.jpg to something like wp-content/gallery/gallery_name-filename.jpg, that is , to replace the last / to -

I have written the code but it does not work as expected

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wp-content/gallery/(.*)-(.*)$ /wp-content/gallery/$1/$2 [L]

My question is: what is wrong with the code? How can i correct it?

Thanks!

share|improve this question
Close-voted as off-topic. This is a server-configuration/.htaccess question, not a WordPress question. – Chip Bennett Aug 24 '12 at 18:29

closed as off topic by toscho Nov 10 '12 at 21:37

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.