Results 1 to 6 of 6

Thread: HELP! Globally Change "base" url??

  1. #1
    New user
    Join Date
    07-09-09.
    Posts
    15

    Default HELP! Globally Change "base" url??

    Hi there,

    I am developing a site on my hosting and the hosting does everything by domain. (It's annoying :evil: ).

    Let's say my site is to be called

    "blah.com"

    my hosting account had to be called "blah.com" so in order to view it (before the domain is pointed at it)I have a URL like this:
    "http://preview.hostingcompany.com/blah.com/index.php"

    But because of the way the hosting is set up (this could be my fault) Typolight looks for "http://blah.com/index.php" which doesn't exist.

    So basically what I'm asking is there a way in which I can add to the root or base url of the website,
    I can do it in the templates for the front end
    like <base href="hhttp://preview.hostingcompany.com/blah.com/"> and that works fine as I only have 2 templates.
    I starting doing the backend but it looks to me like I'm getting further and further into hacking out code that I will have to change back when the site goes live anyway. Plus the backend stuff ran into problems with referrers and stuff.

    Is there a really really simple way of doing this?

    I tried looking at the config and localconfig but I couldn't find anything there to edit,

    I also tried this line to localconfig:
    $GLOBALS['TL_ROOT']='http://preview.hostingcompany.com/blah.com/';
    but I don't think I have it right.

    Can anyone help me out?
    Is there just a setting somewhere I can change rather than messing around with the backend files??

    This is urgent so if anyone can help me I'd really appreciate it!

  2. #2
    User
    Join Date
    06-19-09.
    Location
    Kosice, Slovakia
    Posts
    61

    Default Re: HELP! Globally Change "base" url??

    I would say that running install.php will do the trick. Another option (and better IMHO) is to ask your hosting company to set your account now as if your domain was already working (which may be already done) and just use hosts file to change ip address of blah.com to point to your hosting company.
    S.C.A.R.E

  3. #3
    New user
    Join Date
    07-09-09.
    Posts
    15

    Default Re: HELP! Globally Change "base" url??

    Hi Scare,

    Thanks so much for the reply,

    I can't run the install.php because it redirects to the non existant place when I log in .

    I will look into your second suggestion, cheers.

  4. #4
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: HELP! Globally Change "base" url??

    Try to modify $_SERVER['HTTP_HOST'] and/or $_SERVER['HTTP_X_FORWARDED_FOR'] in your localconfig.php.

  5. #5
    New user
    Join Date
    07-09-09.
    Posts
    15

    Default Re: HELP! Globally Change "base" url??

    Oh Thank you so much that fixed it perfectly,
    And I can just delete that one line when I make the site live!

    That's brilliant , Thank you thank you thank you!

  6. #6
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: HELP! Globally Change "base" url??

    You are welcome

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •