1

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

keeg
  • 419
  • 2
  • 6
  • 11

2 Answers2

1

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)

keeg
  • 419
  • 2
  • 6
  • 11
0

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.

Stephan
  • 999
  • 7
  • 11