I want to make my homepage /home

Posted on 2007-10-10
Last Modified: 2008-01-09
I have my index page as /home/index.php

How do I get the index page to automatically redirect from the top level URL without using header.

can I do something in .htaccess?

Question by:roscoeh23
    LVL 50

    Expert Comment

    by:Steve Bink
    If you redirect, don't you HAVE to use a header?  How else would you get the redirect command to the client?  Here's two methods:

    1) (in PHP) header('location:new-location.php');
    2) (in JS) window.location = 'new-location.php';

    LVL 2

    Expert Comment

    you can also use this method if you would like to display something for a couple of seconds or not...  5 is the amount of time in seconds it will take before it forwards the user on...

    <meta http-equiv="refresh" content="5;url=">

    LVL 2

    Expert Comment

    You can also do this.. as routinet mentioned...

    create a function in your header like this..
    function pushUser(){
         window.location.href = '/home';
    Then in  your body tag call the fucntion onload like this...

    <body onLoad"pushUser();">

    LVL 17

    Accepted Solution

    Inside you httpd.conf or whatever file you are using for site config
    within the
    <virtualhost *>
    Redirect /index.php htttp://

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Title # Comments Views Activity
    Search function not working 14 29
    php explode 3 28
    Impossible arithmetic 8 29
    GPS save in database 19 20
    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now