Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess is not working

Discussion in 'Bind/DNS/Nameserver' started by onsitehelper, Aug 12, 2017.

  1. onsitehelper

    onsitehelper Registered

    Joined:
    Aug 12, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Melbourne
    cPanel Access Level:
    Root Administrator
    Hi all, I'm having trouble with .htaccess file.

    I'm trying to rewrite domain to point to AWS cloudfront. This hasn't worked so I decided to try a rewrite I know has worked in the past on different web servers and this didn't work either.

    I've included both rewrites below, I put these into the .htaccess individually.

    Any idea why this wouldn't work?
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^wp-content/uploads/(.*)$ http://XXXXXXXXXXXX.cloudfront.net/wp-content/uploads/$1 [r=301,nc]
    
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com.au [NC]
    RewriteRule ^(.*)$ http://www.domain.com.au/$1 [L,R=301] 
    
     
    #1 onsitehelper, Aug 12, 2017
    Last edited by a moderator: Aug 12, 2017
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Could you verify the full path to this .htaccess file (replacing the account username with an example), and also verify what's configured for the "Optimize .htaccess (AllowOverride)" option in "WHM >> Apache Configuration >> Global Configuration"?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. onsitehelper

    onsitehelper Registered

    Joined:
    Aug 12, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Melbourne
    cPanel Access Level:
    Root Administrator
    I appreciate you getting back to me. I've already resolved this with support.

    I saw this setting posted in other thread but could never find it in my WHM. Any idea why?

    We are using version cPanel & WHM 64.0 (build 36)
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm happy to see you were able to solve the issue. The referenced option is available in cPanel version 66 (tentatively scheduled for publication to the Release build tier this week).

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice