简体   繁体   中英

HTACCESS image url rewrite

I have this image

http://domain.com/images/2.png

I want this URL

http://domain.com/images/sale-item.png

to open above image, NO Redirect please.

In short the URL http://domain.com/images/sale-item.png will open this image http://domain.com/images/2.png

If you want it to be in DocumentRoot/.htaccess then use this as first rule :

RewriteEngine On
RewriteBase /

RewriteRule ^(_images/corners)/sale-item\.png/?$ $1/2.png [L,NC]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM