How to use .htaccess to rewrite requests from image to PHP script?

后端 未结 2 1766
南方客
南方客 2021-01-23 10:56

I have a PHP script located at http://sb1.dev.codeanywhere.net/~a70097sb/hc/onlinestatus/image.php that requires two GET variables: ign an

2条回答
  •  清歌不尽
    2021-01-23 11:16

    Try something like that:

    
       RewriteEngine On
       RewriteCond %{HTTP_HOST} ^www\.mysite\.com [NC]
       RewriteRule ^hc\/onlinestatus\/(.*)\/(.*)\.png /hc/onlinestatus/image.php?style=$1&ign=$2 [NC,L]
    
    

提交回复
热议问题