1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do you make /index.php into a simple .com/ via php file

Discussion in 'PHP' started by pavelbarchuk, Jul 10, 2009.

  1. #1
    Heres the code from my header.php file. I need to change the /index.php homepage link into a simple website.com/ because thats what my homepage link is.

    
    <div id="navbar"><div id="navbar-left"><div id="navbar-right">
    <table cellpadding="0" cellspacing="0" width=100%><tr><td>
    	<table cellpadding="0" cellspacing="0"><tr>
    	<td><a href="index.php">{$lng.navbar.home}</a></td>
    [CODE]
    Code (markup):
     
    pavelbarchuk, Jul 10, 2009 IP
  2. Dirty-Rockstar

    Dirty-Rockstar Guest

    Messages:
    252
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
  3. lvyassine

    lvyassine Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Change this
    <td><a href="index.php">{$lng.navbar.home}</a></td>

    To:
    <td><a href="/">{$lng.navbar.home}</a></td>
     
    lvyassine, Jul 10, 2009 IP
  4. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would have thought index.php gets accessed by default but maybe some servers don't have this setup
     
    wd_2k6, Jul 10, 2009 IP
  5. anthonywebs

    anthonywebs Banned

    Messages:
    657
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    header("location:http://example.com");
    exit;
    PHP:
     
    anthonywebs, Jul 10, 2009 IP
  6. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #6
    You cant do this, as it will create an infinite loop. Since mysite.com/ is normally requesting index.php, it will infinitely loop.
     
    jestep, Jul 10, 2009 IP
  7. anthonywebs

    anthonywebs Banned

    Messages:
    657
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    in the .htaccess file

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.example.com [R=301,L]
     
    anthonywebs, Jul 10, 2009 IP
  8. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #8
    they're tellin you how to fix it with .htaccess
     
    ezprint2008, Jul 10, 2009 IP