
![]() |
gnarlyhat
I have a YACG config file which is in
PHP... and here's the content.define('THIS_DOMAIN', 'sub.domain.com'); // THE URL OF YOUR SITE (NO HTTP:// OR TRAILING SLASH) define('SITE_NAME', 'Your Site'); // SITE NAME define('SITE_DESCRIPTION', 'Your description'); // DESCRIPTION OF YOUR SITE My question is, I know there's should be some way to display the domain of each site. How do I put it in the config file here so that I don't need to edit the config everytime I setup a new site? gnarlyhat
I tend to ask questions and answer them myself. I think it's a good way to
learn![]() define('THIS_DOMAIN', $_SERVER['HTTP_HOST']); // THE URL OF YOUR SITE (NO HTTP:// OR TRAILING SLASH) define('SITE_NAME', 'Your Site'); // SITE NAME Now I have another question. I build my sites on subdomains so this config would work just right for me. Say I upload it on http://brain.domain.com How do I define SITE_NAME so that it takes "brain" from the full http host of brain.domain.com ? gnarlyhat
define('THIS_DOMAIN', $_SERVER['HTTP_HOST']); // THE URL OF YOUR SITE (NO HTTP:// OR TRAILING SLASH) $self = explode(".",$_SERVER['HTTP_HOST']); define('SITE_NAME', $self[0]); Thank you gnarly. What would I do without you ![]() perkiset
GnarlyHat & "Cybil"
Twins separated at birth or same person?!?! You decide! ![]() Well done GH |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads