how to get rid of /home.php

Discussion in 'HTML & Website Design' started by jasonvan, Nov 6, 2009.

  1. #1
    Hi,

    I'm using a new social engine script for a site (yes bought and paid for).

    The index page is home.php

    This makes my site: http://www.mysite.com/home.php

    I want to get rid of the /home.php

    I assume I need to use an .htaccess file or something.

    Does anyone have any idea on the best way to do this?
     
    jasonvan, Nov 6, 2009 IP
  2. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm a tad lost here. Why not just delete it?

    If instead it defaults to home.php as an index page, get with your host and ask about the order of index pages. I know with some hosting platforms, the webserver defaults to such urls as home.html, home.php, etc and then goes through the index.php's, index.html, etc.

    Or just why not rename it?

    What script is this anyway?
     
    theapparatus, Nov 6, 2009 IP
  3. Freditpl

    Freditpl Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Freditpl, Nov 7, 2009 IP
  4. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #4
    What happens if you simply rename it (and any reference to it) to index.php?
     
    Kerosene, Nov 7, 2009 IP
  5. ifreakz

    ifreakz Well-Known Member

    Messages:
    1,427
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    130
    #5
    Hello,
    From the title of the thread, i could assume you were using socialengine which became even more clear after i clicked the thread.
    Anyway, Basically what socialengine does is it redirects your index.php to home.php which indirectly calls the smarty codes from home.tpl which is in your templates folder. So renaming the index.php to home.php might not exactly work, since there are some links that lead to home.php, so i would suggest you.. Copy the contents of home.php to index.php replacing the current content of index.php
    Alternately, if you want a custom homepage, you can design that and upload it as index.html or index.php with your style css file as style.css in the root dir.
    Do not hesitate to leave a PM, if you need additional help, We are web-developers and we specialize on socialengine.

    Hope that helps.
     
    ifreakz, Nov 7, 2009 IP
  6. jasonvan

    jasonvan Member

    Messages:
    363
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    35
    #6
    Yes, I used this solution as a temporary fix. Thank you. It worked great. I simply added the code to a .htaccess file and uploaded it...and voila.

    The solution from Ifreakz was also a very good solution, but it would have taken a bit more time.

    Yes, this is a socialengine site, so you cannot just rename the file. Ifreakz (i hope I'm not mispelling your name) - are there any issues with just using a .htaccess file? Also, I will definitely pm you when I want to redesign my index page (which will be very soon).

    Thank you.
     
    jasonvan, Nov 7, 2009 IP
  7. ifreakz

    ifreakz Well-Known Member

    Messages:
    1,427
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Why does it take more time? It's a copy paste job eh.

    Editing htaccess file isn't the clever way, your htaccess file should be meant for the security of your site and profile re-directions. So make sure your site is highly secure.

    Also, We design the core script as well, Not just index. Will be glad to hear from you soon.

    Cheers
     
    ifreakz, Nov 7, 2009 IP
  8. 123funda

    123funda Member

    Messages:
    462
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #8
    if you will change your home.php to index.php your other links coming to home.php will be broken, for doing this also change the home.php into index.php in the links of all other pages
     
    123funda, Nov 8, 2009 IP
  9. Deus Ex

    Deus Ex Peon

    Messages:
    531
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Nice little .htaccess command, I'll use that later on with a site, especially if I start running SocialEngine sites.

    Also, never rename a file from home.php to index.php -- the tpl and python as well as smarty templates will break upon doing so with SE
     
    Deus Ex, Nov 9, 2009 IP
  10. ifreakz

    ifreakz Well-Known Member

    Messages:
    1,427
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    130
    #10
    No, it won't break.
    You can try renaming user_group.php to my_group.php - it basically stands the same, just that when you edit user_group.php you'll find the second line saying user_group which is actually the template file, so make sure user_group.tpl exists as it is. Alternatively, you can rename both and change the second line in the php file that calls the tpl.

    The problem with renaming index.php to home.php as explained in above post is - There are many links in the header and around the script which will link to home.php instead of a '.'
    '.' the dot refers to the site root, which can be index.php or index.html

    So if's not a dot, i.e if it's linked to home.php then it'll simply show a 404 error, therefore i suggested to copy the contents to index.php.
    For a permanent solution, such that home.php dosen't exist all over, we either have to url redirection or search the core for all instances (if any) - replace.
     
    ifreakz, Nov 9, 2009 IP
  11. dhaval300

    dhaval300 Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    rename home.php to index.php
     
    dhaval300, Nov 9, 2009 IP