Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Make a simple personal CDN/trunk

Hi!

Right now I have multiple site and because of many reasons, I want to make a subdomain called CDN (I know what CDN really is. just keep reading :D) in one mother site and start calling stuff from it. fonts, css frameworks and lots of other stuff.

But I don't want to allow people to steal my bandwidth. I mean loading those fonts in their site but addressing from my server.

What should I do? .htaccess, CHMODE or ...?

Thank you an advanced

;)

2 Answers

You would use .htaccess to prevent hot-linking. See this webpage: http://www.javascriptkit.com/howto/htaccess10.shtml

I don't understand why you would want a sub domain if you don't really have a content delivery network. You haven't made it clear if the subdomain will point to the same server. Depending on the case, you could look at using a reverse proxy.

It's like this

Most of these sites' users go to the other sites too... and loading jquery,bootstrap and lots of other stuff uses bandwidth.

All I'm doing is to make a simple place where I can link thoes files easily and do not repeat them for every project

That link helped, but there is still 1 little question. can I duplicate the snippets and just use several domains that I have? or there is much more to do?