• Hi

    I’m having some trouble accesing the media page on my wordpress admin. When I click on “media”, I get a 403 forbidden error page. Following the suggestions on that page, I think that the error comes from the .htaccess file. If I delete it, it works just fine.

    But I would like to know which part of it is causing the problem. Recently, the file was modified by my hosting (siteground) because they told me I was vulnerable to attacks from bots.

    Here’s my .htaccess file (I think the “deny from” section is causing the problem):

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>
    ## EXPIRES CACHING ##
    
    # 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
    
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    
    <filesMatch ".(ico|pdf|flv|jpg|svg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "max-age=84600, public"
    </filesMatch>
    
    # BLOCK BLANK USER AGENTS
    RewriteCond %{HTTP_USER_AGENT} ^-?$
    RewriteRule ^ - [F]
    
    ##Deny access to all CGI, Perl, Python and text files
    <FilesMatch ".(cgi|pl|py|txt)">
    Deny from all
    </FilesMatch>
    ##If you are using a robots.txt file, please remove the
    # sign from the following 3 lines to allow access only to the robots.txt file:
    <FilesMatch robots.txt>
    Allow from all
    </FilesMatch>
    AddHandler application/x-httpd-php56 .php .php5 .php4 .php3

    Thank you in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello gasto
    Please remove following lines from your .htaccess and check once more

    ##Deny access to all CGI, Perl, Python and text files
    <FilesMatch ".(cgi|pl|py|txt)">
    Deny from all
    </FilesMatch>

    Adding only this .htaccess file will solve your issues.

    # 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

    Thank you

    Thread Starter gasto

    (@gasto)

    Thanks a lot!

    You Welcome gasto

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘403 Forbidden Error on Media Upload’ is closed to new replies.