# How to restrict access to video by url pattern

**URL:** <https://community.wowza.com/t/how-to-restrict-access-to-video-by-url-pattern/39682>\
**Category:** Wowza Streaming Engine\
**Created:** [June 21, 2014, 2:54pm UTC](https://community.wowza.com/t/how-to-restrict-access-to-video-by-url-pattern/39682 "2014-06-21T14:54:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Shmayev](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Sam\_Shmayev](https://community.wowza.com/u/Sam_Shmayev)\
**Post date:** [June 21, 2014, 2:54pm UTC](https://community.wowza.com/t/how-to-restrict-access-to-video-by-url-pattern/39682/1 "2014-06-21T14:54:59Z")

</div>

Hi,

Assume we have

This url has private access (restrict video!)

rtmp://somehost/live/_definst_/ **PRIVATE** /myStream.stream

This url has public access (allow video!)

rtmp://somehost/live/_definst_/ **PUBLIC** /myStream.stream

How could it be done?

Thanks,

any ideas appreciated

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [June 21, 2014, 1:53pm UTC](https://community.wowza.com/t/how-to-restrict-access-to-video-by-url-pattern/39682/2 "2014-06-21T13:53:32Z")

</div>

The “PRIVATE” and “PUBLIC” parts of your URLs are part of the stream name. So if it is just RTMP clients, you could use could override play to restrict playback [as shown in this example](https://www.wowza.com/docs/how-to-override-play-to-remap-a-stream-name). If other client types are involved you could use IMediaStreamNameAliasProvider2 to look at what play requests and block as necessary.

Richard

---

<div class="post-metadata">

**Author:** ![Sam\_Shmayev](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Sam\_Shmayev](https://community.wowza.com/u/Sam_Shmayev)\
**Post date:** [June 22, 2014, 6:30am UTC](https://community.wowza.com/t/how-to-restrict-access-to-video-by-url-pattern/39682/3 "2014-06-22T06:30:48Z")

</div>

Hi,

IMediaStreamNameAliasProvider2 doesn’t work with stream files.

---

<div class="post-metadata">

**Author:** ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)\
**Post date:** [June 23, 2014, 10:31am UTC](https://community.wowza.com/t/how-to-restrict-access-to-video-by-url-pattern/39682/4 "2014-06-23T10:31:52Z")

</div>

Answered [here](http://community.wowza.com/t/-/39683).

Roger.
