Hi all, I am a new member. I don't know much about .htaccess and I hope somebody can help me. My website is: www.carmenguedez.com I have moved all my .html (paintings) to .php from the gallery folder. See examples: redirect 301 /gallery/tres_llaves.html http://www.carmenguedez.com/gallery/tres_llaves.php redirect 301 /gallery/vintage.html http://www.carmenguedez.com/gallery/vintage.php redirect 301 /gallery/true_story.html http://www.carmenguedez.com/gallery/true_story.php redirect 301 /gallery/peace-and-love.html http://www.carmenguedez.com/gallery/peace-and-love.php I have many paintings and I would like to know if I can reduce all these codes to only one code using either redirect 301 or mod_rewrite, whatever is best. I would appreciate your help. Thanks, Carmen
Do you have any pages that are still .html? If you convert all of them to .php then just do a RewriteRule ([^\.html]*).html http://www.carmenguedez.com/$1.php [L, R=301] In mod_rewrite
Try to find some common ground between all the php pages then. For example, are all the pages within the gallery folder in .php? If so, you could just prepend a /gallery/ before the regex I gave.
Yes, all .php pages are within the gallery folder. Sorry for my ignorance! I added this code to my htaccess and gave me a 500 internal server error: RewriteEngine On RewriteRule ([^gallery\.html]*).html http://www.carmenguedez.com/gallery/$1.php [L, R=301] What I am doing wrong? Thanks so much.
Sorry, I should have been a little more specific. /gallery/([^\.html]*).html http://www.carmenguedez.com/gallery/$1.php [L, R=301]