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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess is not working

Discussion in 'Bind / DNS / Nameserver Issues' 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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,165
    Likes Received:
    1,371
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,165
    Likes Received:
    1,371
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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!
     
Loading...

Share This Page