We are scaling up the website, and we would like to plan for the future where we might want to place our images in a subdomain (or, possibly, even in a separate domain, for example CDN ). We are currently referencing images in our HTML / PHP code using the following HTML code:
<img src="/images/ourlogo.jpg" alt="Our Logo" />
I was thinking about starting a company agreement to switch to:
<img src="<?php echo STAT_IMG;?>ourlogo.jpg" alt="Our Logo" />
where STAT_IMG is a global PHP constant that would initially be defined as identical to the current situation, i.e.
define('STAT_IMG', '/images/');
but can later be changed to something like:
define('STAT_IMG', 'http://www.superfastcdn.com/');
Will I encounter any problems doing this?
Things I've already thought about:
- , , , .
- ( , PHP HTML ).
- , https ( -). , , (, gmail) https, , http ( ), (, IE). encosia ,
STAT_IMG " ", . define('STAT_IMG', '//www.superfastcdn.com/');. , .- , .
define('STAT_IMGS', 'https://www.example.com/images/'); define('STAT_IMGNS', 'http://www.example.com/images/'); (define('STAT_IMG', '/images/');).
- , javascript CSS.