# fv-player/trunk/includes/class.bunnycdn.rewrite.php

FV Player 8, version trunk. 14 lines.

- Page: https://pluginprobe.com/plugins/fv-player/trunk/code/includes/class.bunnycdn.rewrite.php
- Raw: https://pluginprobe.com/plugins/fv-player/trunk/raw/includes/class.bunnycdn.rewrite.php
- Modified: 2024-08-06T09:08:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fv-player/trunk/code/includes/class.bunnycdn.rewrite.php#L10-L20`.

```php
<?php

if( !class_exists('FV_Player_BunnyCDN_Rewrite') ) {

  class FV_Player_BunnyCDN_Rewrite extends BunnyCDNFilter {
    public function rewrite_url( $url ) {
      $directoriesRegex = implode('|', $this->directories);
      $regex = '~(?:'. quotemeta($this->baseUrl) .')?/((?:'.$directoriesRegex.').*)~'; // custom regex to match url
      return preg_replace_callback($regex, array(&$this, "rewriteUrl"), $url);
    }
  }

}

```
