WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Forbidden Access on new install (3 posts)

  1. SexyDawnT
    Member
    Posted 1 year ago #

    I just created a new wordpress blog today, but am having some problems with accessing some of the files in my browser and am getting erros. For instance on ANY of the theme files (including the default Twenty-Twelve theme), I get a forbidden error like the one below.

    When I try to access this file:
    http://sunshineflgirl.freenclearstuffnewsletter.com/wp-content/themes/twentytwelve/screenshot.png

    I get this

    Forbidden
    You don't have permission to access /wp-content/themes/twentytwelve/screenshot.png on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    These are the steps I have taken to try to solve this:

    1. Complete fresh WordPress install with fresh files
    2. Adding this code to both the .htaccess file for this site and the one in the Public_Html folder:
      <IfModule mod_security.c>
          SecFilterEngine Off
          SecFilterScanPOST Off
      </IfModule>
    3. Change file permissions on the affected folder so that all the images are 755

    This site is in a public_html folder that has it's own .htaccess file. Deactivating that file in the main folder causes these files to be accessible. However, none of the other sites in the Public_html folder are having this issue, so I can't figure out why the .htaccess would impact only this new site and none of the others.

    By process of elimination, I have determined that it is this code in the main .htaccess file that is causing problems with this site (but no other)

    RewriteEngine on
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

    Does anyone have any suggestions on how to fix this?

    Thanks in advance for your assistance.

  2. SexyDawnT
    Member
    Posted 1 year ago #

    Ok - so the domain name is fully propogated and I am still having this issue.

    When I go to this link (or any other image):
    http://livinginlyrics.com/wp-content/themes/twentytwelve/screenshot.png
    I get this error:

    Forbidden
    
    You don't have permission to access /wp-content/themes/twentytwelve/screenshot.png on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Any ideas?

  3. SexyDawnT
    Member
    Posted 1 year ago #

    Ok - After several hours, I finally found the trouble. For some reason, WordPress was not creating an .htaccess file, so I was creating one. Whenever I checked my .htaccess file to another wordpress .htaccess file, I found this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    I updated the .htaccess code to reflect that and the problem is solved.
    So, hopefully, if anyone else has any trouble with this, my solution can help them.

Topic Closed

This topic has been closed to new replies.

About this Topic