Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am developing a website on my own development servers. The client is loading some fonts that are white-listed on just their domain, the problem is that during development I cannot see them on my dev server. Someone said I can somehow alias the domain via Apache and use a hosts file to point at the domain so the request for the fonts gets through as though from the appropriate domain since they've white-listed *.theirdomian.com

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

So I have successfully aliased the client's domain to my own server. Here is how:

In your vhosts.conf file create an alias to a fake subdomain to your clients site. For example if your client is www.myclient.com create local.myclient.com or something:

<VirtualHost *:80>

     ServerAdmin admin@mydomain.com
     ServerName dev.mydomain.com
     ServerAlias local.myclient.com
     DocumentRoot /var/path/to/your/files/dev.mydomain.com/html/

     <Directory />
         Options FollowSymLinks
     </Directory>
     <Directory /var/path/to/your/files/dev.mydomain.com/html>
         Options Indexes FollowSymLinks MultiViews
         Order allow,deny
         allow from all
     </Directory>

</VirtualHost>

Don't forget to issue the reconfigure command on your Apache server and restart.

In your hosts file on your local machine, point the ip of your server (dev.mydomain.com) to the fake domain:

xxx.xx.xx.xxx     local.myclient.com

Go to local.myclient.com in your web browser and you should see the contents of dev.mydomain.com. The calls will seem to come from the client domain, and fonts will be white listed (so long as they've white-listed *.myclient.com and not www.myclient.com)

share|improve this answer
add comment

I'd do a test if you can curl or wget the font files directly. If you can, you'll need some server configuration to make them accessible; some browsers make it very difficult to do cross domain fonts. If you can't, you'll need to acquire those fonts directly from your client.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.