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.

.htaccess related question

Discussion in 'Apache' started by genius, Jan 4, 2008.

  1. #1
    How can I change the order of the files that are accesed when I type my domain.To more specific I want the first file that openes when I acces www.rsgsm.com to be index.php not index.htm .How can I change this ? I belive that something in .htaccess but how ? I can't even acces the file ..Please can you help me ?
     
    genius, Jan 4, 2008 IP
  2. archgames.net

    archgames.net Well-Known Member

    Messages:
    532
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #2
    do you have two files index.php and index.html?

    or you just have index.php?

    if it is just index.php then it would go to it first automaticly
     
    archgames.net, Jan 4, 2008 IP
  3. boltok

    boltok Active Member

    Messages:
    257
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    78
    #3
    That depends on the order the files are specified in the server's "DirectoryIndex" setting. E.g. this would cause index.php to load first:

    DirectoryIndex index.php index.html

    However, changing this may or may not be in your control. It depends on whether your server host has allowed it to be changed in .htaccess.
     
    boltok, Jan 4, 2008 IP
  4. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #4
    I have index.php and index.htm , and the site was moved to a new server and now the file that is accesed is index.htm not .php how it was before.I've spoken to my host and he said that it's not from the server and maybe I should look at .htaccess , but how do I do this ? Or where I can change this setting so that index.php is the first ?
     
    genius, Jan 4, 2008 IP
  5. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #5
    put this in the .htaccess file :
    Directory Index index.php index.html
    that way the .php files will be open first
     
    maiahost, Jan 4, 2008 IP
    mcfox likes this.
  6. LittleJonSupportSite

    LittleJonSupportSite Peon

    Messages:
    386
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The proper way to do this is to locate your httpd.conf file and add an additional entry:

    
    
    DirectoryIndex index.html
    
    
    Code (markup):

    To

    
    
    DirectoryIndex index.php index.html index.htm  mystartpage.html mystartpage.php
    
    
    Code (markup):
    I am sure you can follow the logic there

    Now restart apache and you should be good to go.
     
    LittleJonSupportSite, Jan 4, 2008 IP
  7. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #7
    I've tried to do what you told me but I've encountered another problem , how do I open .htaccess ? I've tried from my file manager and it doesn't work.I'm using Cpanel and the Apache version is 2.0.61.I've something in Cpanel named Apache Handlers , does it have anything to do with my problem ? Or from where can I modify .htaccess ?
     
    genius, Jan 4, 2008 IP
  8. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #8
    Use the file manager in cpanel. Find the .htaccess file and click 'edit'.

    Of course the quickest way to fix the problem you have is to simply delete the index.htm file. ;) I presume it was added automatically by the host and is nothing to do with your website, right?
     
    mcfox, Jan 5, 2008 IP
  9. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #9
    I can't edit it , I don;t know why , but I have attached a photo to see what appears when I find .htaccess.The file index.htm is added by me and is the english version of the site.Index.php determins on which page to send the visitors to the english version or the other one.Before it worked but now the site was moved to a new server and it doesn't work anymore.I can't just delete it I'd have to chage every file of my site + that the file is indexed in google and if I delete it or rename it it won't be there anymore.

    And the picture :

    [​IMG]
     
    genius, Jan 5, 2008 IP
  10. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #10
    As you require index.htm you will need to edit .htaccess as outlined by maiahost above. I have no idea what the screenshot is supposed to be telling me other than there is an .htaccess file when you search for one. :/ Try editing with an ftp client.
     
    mcfox, Jan 6, 2008 IP
  11. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #11
    If you have to search for it to see it, maybe you don't have View Hidden Files on. When you enter the file Manager check "Show Hidden Files(dotfiles)".

    BP
     
    blueparukia, Jan 6, 2008 IP
  12. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #12
    I think I've managed to fix it , can you please tell me if you see the page in english when you access www.rsgsm.com ?
     
    genius, Jan 6, 2008 IP
  13. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #13
    I see index.htm
     
    mcfox, Jan 7, 2008 IP
  14. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #14
    It's ok , thank you all for your help !
     
    genius, Jan 7, 2008 IP