I am facing 404 errors from previous 1 month causing my website down in search engine, the 404 not found URL format is http://mywebsite.com/gallery/postcard.img707.htm Working URL is http://mywebsite.com/gallery/img707.htm I want to remove this postcard from the URL, please help in this Thanks
try this Options +FollowSymLinks RewriteEngine on RewriteRule gallery/postcard.img707.htm$ http://mywebsite.com/gallery/img707.htm [R=301,L] Code (markup): if the 707 is dynamic and there are other numbers in other urls where the same problem appears then you can do Options +FollowSymLinks RewriteEngine on RewriteRule gallery/postcard.img([0-9]*).htm$ http://mywebsite.com/gallery/img$1.htm [R=301,L] Code (markup): hope it works
RewriteEngine On #RewriteBase / RewriteRule ^sitemap.xml$ google.php RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING} RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING} RewriteRule gallery/postcard.img([0-9]*).htm$ http://mywebsite.com/gallery/img$1.htm [R=301,L] #Mod_bmollet : Image name in URL RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING} RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING} RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING} RewriteRule ^img([0-9]+)\.htm$ details.php?image_id=$1&%{QUERY_STRING} RewriteRule ^img([0-9]+)\.([a-zA-Z0-9]+)\.htm$ details.php?image_id=$1&mode=$2&%{QUERY_STRING} #Mod_bmollet : This is to make search function work ( redirect links from search results ) RewriteRule ^search\.htm$ search.php?%{QUERY_STRING} RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING} RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING} RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING} Code (markup):
Sorry to mention the url is http://pukhtoogle.com/gallery/postcard.img329.htm working URL is http://pukhtoogle.com/gallery/img329.htm 329 is dynamic image numbers.
Not working dear, we should change the mywebsite.com and /gallery to something dynamic as other lines has already.