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.

Redirection Issue on cPanel.

Discussion in 'General Discussion' started by alifazman, Mar 7, 2011.

  1. alifazman

    alifazman Active Member

    Joined:
    Sep 27, 2010
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Malaysia
    Hello,

    I'm trying to do a url redirection through cPanel Domain tools (redirects). However, I faced error when I want to apply the redirection. Error as following :

    HTML:
    Unable to write to .htaccess: /home/username/public_html/.htaccess
    I did change the permission and recreate the .htaccess file. But it doesn't seem to fix the error. Does anyone have any idea on fixing this?
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hey,

    Can you check whether any attributes set for the .htaccess.

    lsattr /home/username/public_html/.htaccess
     
  3. alifazman

    alifazman Active Member

    Joined:
    Sep 27, 2010
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Malaysia
    Hello buddy :)

    Thanks for your reply. I issued the command and the result as following :

    Code:
    ------------- /home/username//public_html/.htaccess
     
  4. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    There are no attributes set. So it is not causing the issue. Are you sure the ownership of the .htaccess is user.user. Also ensure permission is 644. If you are still facing issues paste the last portion of the error log after issuing the below given command.

    grep user /usr/local/apache/logs/error_log


    Can you also post the result of ls -ld /home/user/public_html ?
     
    #4 LinuxTechie, Mar 8, 2011
    Last edited: Mar 8, 2011
  5. alifazman

    alifazman Active Member

    Joined:
    Sep 27, 2010
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Malaysia
    Hi there :)

    I have set the permission to 644. No luck. Yeah the owner is the user itself.

    there is no result when i grep for the error log.

    the result for ls -ld is as following :
    Code:
    drwxr-x--- 12 612 nobody 4096 Mar  8 14:43 /home/user/public_html/
    Any idea? :)
     
  6. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hey,

    The ownership is set wrong for public_html.

    Execute this

    chown user.nobody /home/user/public_html and retry.
     
  7. MattLee

    MattLee BANNED

    Joined:
    Aug 26, 2009
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    cPtechie appears to be correct; the "612" entry in your ls -ld should be the username of the account and not a user number.
     
  8. alifazman

    alifazman Active Member

    Joined:
    Sep 27, 2010
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Malaysia
    Oh my god..why i didn't notice that.

    Anyway, thanks guys. :)
     
  9. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hey!

    You are entirely welcome. Cheers!
     
  10. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    the entire thread is so helps to other, having the issue & fixed it out through this.
     
Loading...

Share This Page