How to get absolute URL from my site

Asked

Viewed 176 times

0

On my site in the configuration file (config.php) I use a constant defined as HOME that contains the full address of my site (http://www.meusite.com.br). I use this constant in include, require and to call css and js files. The problem was when I sent the files from my website to the hosting server. For security the parameter allow_url_include is disabled, making it impossible to use Urls as a constant in my code.

My question is which alternative to use in this case so that I can get an absolute URL (Root directory) of my site and make use of it in the same way I did before?

I appreciate the help!

  • 2

    $_SERVER['DOCUMENT_ROOT'] doesn’t solve?

  • I think you’re doing it wrong because the right thing would be to include the files in the physical path. See @stderr’s comment

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.