I have a directory in my root called images. I have a naming convention of number-category.jpg. I am using this convention through a PHP script and would like to have a RewriteRule in my htaccess that does something to the effect of word-word-category-number.jpg for SEO purposes.
So what was once ‘10-abstract.jpg‘ is now ‘fine-art-abstract-art-10.jpg‘
I was reading some tutorials and came up with below with no success:
RewriteRule ^([0-9]-[a-z])-art.jpg$ /2/art/$1-$2.jpg [L]
For
word-word-category-number.jpg, try:But that’s not going to work for your example because
fine-art-abstract-art-10.jpgisword-word-category-word-number.jpg. You can add another section for that:And that’ll take a request for
http://your.domain.com/fine-art-abstract-art-10.jpgand serve/2/art/10-abstract.jpg.