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

后端 未结 2 1806
南方客
南方客 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:00

    You're on the right track. The capture pattern ([^/]+) matches everything up to the next /, so you'll need two of those.

    RewriteEngine On
    RewriteRule ^([^/]+)/([^/]+)\.png$ image.php?style=$1&ign=$2 [L,NC]
    

提交回复
热议问题