我需要重定向以下示例:
http://example.com/contents/2018/01/image.png 至 http://cdn.example.com/cdn.php?url=contents/2018/01/image.png
非常感谢!
答案 0 :(得分:0)
你可以通过mod-rewrite来做这样的事情:
RewriteEngine On RewriteRule ^/contents/(.*)/(.*)/(.*)$ http://cdn.example.com/cdn.php?url=contents/$1/$2/$3 [R=301,L]