Free access in Wordpress directory to print images? . htaccess

Asked

Viewed 888 times

-1

I have a problem in Wordpress, I am uploading the images in a specific directory and I need these images to be viewed directly by URL.

From the root of the portal there is a directory called server and inside it has a directory called images, then the access would be:

http://www.meusite.com/server/imagens/minhafoto.jpg

However, Wordpress does not allow direct access to this directory, as example above, presents error 404.

How do I release this rule on .htaccess wordpress?

Follow my . htaccess

# 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

2 answers

5

If showing page not found, it is because the file does not exist, wordpress does not restrict access to folders unless you explicitly configure this in . htaccess, this default wordpress setting does not affect this.

By default you can access all Assets directly. (. css,. js,. png, etc.).

  • However, there is still the problem and the file exists.

  • 1

    I assure you that there is some problem with the address you are accessing, if the image existed and you only have this setting on . htaccess, should display at least "Permission denied" if there was a permission problem or the image would be displayed. .

  • In fact Erico, it was a problem in the same URL, I managed to make the image appear. THANK YOU.

  • No problem. Please mark the question as solved so it no longer appears in "No answer"

2


This is not a Wordpress issue, as the colleague said above the WP does not block direct access to this type of file. Do these images appear on your website? I had similar problem when the images did not have read permission on the server, but in my case the return was 403 and not 404, are you sure the files exist right? If yes, then check write permissions or contact the server support.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.