Results 1 to 5 of 5
  1. #1
    Join Date
    May 2007
    Posts
    438

    Editing .htaccess in root with cpanel

    At present I load all of my sites to my server via WHM -> List accounts / create

    Nothing resides in "root" (If you type my serverip, nothing shows)
    How can I add a .htaccess file to this? I went in via sftp earlier and uploaded a robots.txt for test, went to but it still gave a 404 header.

    I disconnected ftp & went back, the file was still there. Not sure why it was passing a 404. Do I have to run a special command in ssh to say "hey there's new files here"?

  2. #2
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    414
    When you say root, Do you mean apaches document root when you view an IP bound to your server?.
    If so, you need to add the files to /usr/local/apache/htdocs/

  3. #3
    Join Date
    May 2007
    Posts
    438
    That was it, now I can add files.

    I cannot seem to get a .htaccess to work though. They work in all of the other domains, but not htdocs.

  4. #4
    Join Date
    Jun 2006
    Location
    Chicago
    Posts
    462
    Quote Originally Posted by gpl24 View Post
    That was it, now I can add files.

    I cannot seem to get a .htaccess to work though. They work in all of the other domains, but not htdocs.
    Did you create the file via ssh? Run the following to be sure ownership/permissions look alright:

    // This will give you a quick glance of the file. Paste it here.
    ls -la | grep .htaccess

    // Let's reset the permission on the .htaccess file
    chmod 644 .htaccess

    If changing permission on the file does not work, paste your httpd.conf here, along with the output of the above command. It's likely an ownership issue in that case....

  5. #5
    Join Date
    Aug 2004
    Location
    Tampa, Fl
    Posts
    51
    You may have to modify your "options" statement in /usr/local/apache/conf/httpd.conf, if it looks like this:

    Code:
    <Directory "/usr/local/apache/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    Probably change the "AllowOverride None" to "AllowOverride All" or something

  6. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Related Posts from theWHIR.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •