.htaccess - htaccess add RedirectMatch 301 rules -


i add rules .htaccess file:

redirectmatch 301 /wp-content/my-image-5x5.jpg /wp-content/default-5x5.jpg 

redirect works well, add old image name address. why? don't need this.

what i'm now: www.mypage.lt/wp-content/default-5x5.jpg?file=/wp-content/my-image-5x5.jpg

what need: www.mypage.lt/wp-content/default-5x5.jpg

redirect works well, add old image name address. why? don't need this.

this because have wordpress rules internal routing (to index.php file) , rewrite rules belong mod_rewrite, while redirectmatch directive belongs mod_alias. these modules both applied @ different points in url-file mapping pipeline, both applied, , end mangled redirect url. should stick mod_rewrite in instance. try adding these rules before wordpress rules:

rewriteengine on rewriterule ^/?wp-content/my-image-5x5.jpg /wp-content/default-5x5.jpg [l,r=301] 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -