Help with index page and .htaccess

Discussion in 'HTML & Website Design' started by elvisshades, Mar 13, 2008.

  1. #1
    Hi guys,
    So right now my site it setup as a portal page as the front page which then will get you to my forum (/forum) though a link on the portal page.

    For some reason, when you go to www.mysite.com you get redirected to www.mysite.com/forum/portal.php. Functionally, that works fine but I'm trying to get it to go to the portal.php but without it saying www.mysite.com/forum/portal.php on the address bar. I'm losing my google PR of 2 on www.mysite.com and have no ranking on www.mysite.com/forum/portal.php. I've tried everything I can think of using .htaccess and the index.html in my root but I think I'm just doing something wrong.

    Currently, my .htaccess (in root) is: DirectoryIndex forum/portal.php index.php index.html index.htm.

    The index.html (in root) is:
    <html>
    <head>
    <title>Redirecting...</title>
    <<meta http-equiv="refresh" content="0;url=forum/portal.php">
    </head>
    <body>
    </body>
    </html>

    What should I change or take out? Thanks guys...this has been a pain in the neck for the last week! :D
     
    elvisshades, Mar 13, 2008 IP
  2. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #2
    Take out the meta refresh from the index.html page, you don't need it.

    You will need to add a 301 redirect to the .htaccess so the SE's know the site is now residing on the portal page. That should keep your PR.

    Dunno about the address bar thing though.

    Why don't you just put the forum in the root area anyway, if that's all you are using the site for? Or do you have future plans that may require the forums to be where they are?
     
    mcfox, Mar 13, 2008 IP
  3. elvisshades

    elvisshades Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the reply. I've deleted the index.html file completely from the root and now I'm just using the .htaccess file.

    If I were to use the 301 redirect, how what text (code) would I enter to make www.mysite.com/forum/portal.php redirect to www.mysite.com? Thanks!
     
    elvisshades, Mar 14, 2008 IP
  4. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #4
    You don't. You redirect the other way - from root / to /forum/.
     
    mcfox, Mar 14, 2008 IP
  5. 9450184

    9450184 Peon

    Messages:
    30
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Do you have mod rewrite enabled? With mod rewrite you can make a nice redirect, and your status bar would still show www.mysite.com
     
    9450184, Mar 14, 2008 IP
  6. elvisshades

    elvisshades Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Where would I find the mod rewrite to see if its enabled? It that something preinstalled on my server? That sounds like exactly what I need!
     
    elvisshades, Mar 24, 2008 IP
  7. elvisshades

    elvisshades Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    For anyone who was following along, this is how I fixed it:

    I kept the .htaccess file in root, removed the index.html file. Then I added <base href="http://www.mysite.com/forum/"> to the overall_header.tpl. It worked like a charm!
     
    elvisshades, Apr 3, 2008 IP
    mcfox likes this.