The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I accidentally deleted my .htaccess file

Discussion in 'General Discussion' started by catsgrave, Mar 24, 2006.

  1. catsgrave

    catsgrave Registered

    Joined:
    Mar 24, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    hi cpanel gurus,

    I accidentally deleted my .htaccess file. I don't know how to restore it
    Is this file important? pls help

    Thanks,
    mervin
     
  2. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    It depends on what you had in that file. Check if your site is working as it should be, does it have any 500 Internal server erros? How ever it is always possible to create that file.

    So one more lesson to know importance of backups... ;)
     
  3. catsgrave

    catsgrave Registered

    Joined:
    Mar 24, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    if my website is http://www.catsgrave.com when i key tat in the browser it doesnt automatically goes to my index.php

    how could i configure it so when i just type www.catsgrave.com it goes into the main page without adding the.com/index.php?

    thanks
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    The behaviour you describe, that is going to http://example.com/index.php when you visit the URL in http://example.com/, should be handled by Apache by default.

    However there are a variety of default handlers that Apache may use, chosen based on the order they are supplied in the configuration file. For example if you had an index.html and an index.php file, it is likely that Apache will default to the .html file if present, instead of defaulting to the .php file.

    The most straightforward solution would be to remove all index.* files, leaving only index.php.

    If this is what you have done, you should contact your host to see if Apache is configured correctly.
     
  5. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Just add this line in your .htaccess

    Code:
    DirectoryIndex index.php
    and it should fix your problem.
     
Loading...

Share This Page