How to load code locally?


I was wondering how to load code or graphics locally.

Say for example a pluggin calls for and my website is and I want to run that as

Without going into the complex individual scripts, is there a simple way to redirect, say in the htaccess, this file to indicate it’s new location is stored locally and not to go out to to get it?

The idea is to minimize load times and not rely on distant hosts for the information.


No, you would either need to rewrite the plugin or use a test script for webpagetest to have to redirect to

It’s not a complex script. Something like this should do it:



The code above, I would put that in the htacess?
Not sure what ‘test script for webpagetest’ is.


Sorry, in the advanced settings there is a “script” tab where you can paste in a webpagetest script (used for more complex testing and multi-page flows).

I still can’t see the connection.

I’m guessing from the question posted that storing, say a graphic file locally, cannot be done through any type of redirect to avoid pulling the data from a remote domain.

Sorry, thought you just wanted to see “what if” for testing. To do it for real users you’d have to modify the plugin itself and chances are you’d probably break something by doing it.