how to block specific url in my droplet?

October 23, 2017 138 views
CMS Ubuntu 16.04
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??

1 Answer

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.

Have another answer? Share your knowledge.