how to block specific url in my droplet?

I have a wordpress site in my droplet and i have a directory folder named 
"tv_channels" where i put many html and php files which is not ally with 
wordpress...... whenever i post anything then i embed a file from that directory
but users are going only that folder directly and access my those php/html files.
now i want to block that url for user besides i want to embed my files in post.....

Can you guys help me out??


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It would be better if we had more details, but assuming you are running apache, and assuming you mean that users are able to view what’s in your “tv_channels” folder directly, then this answer should help.

If you are on NginX, you could block access to that folder, and then have a backend processor, like PHP, grab and display the file directly to the user. That way only humans should be able to access the file, and only one at a time, as displayed by the page.