Web Analytics Made Easy -
StatCounter Making this work?? - CodingForum

Announcement

Collapse
No announcement yet.

Making this work??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Making this work??

    Hello,

    Basicly I want this to redirect to the "/" on my site for instance the index page, if some goes on a page like /images/ i want it to redirect them to "/" so i used this:

    PHP Code:
    <?php
    header
    'Location: $_SERVER['HTTP_HOST']' ) ;
    ?>
    im very new with php and it didnt work, i want it like this because my site runs of alot of different domains so i want it to stay on the same domain.

    Thanks alot,
    James

  • #2
    Try this:
    PHP Code:
    <?php
    header
    "Location: ".$_SERVER['HTTP_HOST'] );
    ?>

    Comment


    • #3
      hmm thats redirecting me to( if i access /includes/:

      http://site.co.uk/includes/site.co.uk

      Comment

      Working...
      X