Hello guys what can be the reason for this:
I have a folder “wallpapers” not related to my website (WordPress) in the same web hosting and images inside. If i wanted to access them I would go to website.com/wallpapers/myimage.jpg and it worked!
But I noticed it doesn’t work anymore now I see my wordpress site + error 404 inside the website.
I have tried to fix this disabled few plugins etc… but where should I look? What can be the reason? Maybe the htaccess?
Thanks!
Yes, I think your guess on the .htaccess is perfectly correct. If you enable permalinks in WordPress it automatically creates, or tries to create (depending on permissions) the following .htaccess file;
The two lines in this that are relevant to you are;
What they are basically doing is making sure that every url request gets run through the index.php in the root except any files or directories that actually exist as separate files and directories outwith the WordPress install (ie your wallpapers directory). So first of all I would make sure that your .htaccess looks like this.
I needed to do the same in the past, and it drove me nuts so if that can help here’s what I’ve done. I had the default .htaccess wordpress created in my wordpress folder when activating the permalinks option, the folloowing :
for some reason…
I could access http://example.com/phpinfo.php fine,
but http://example.com/myfolder was returning a 404, despite (if I’m correct) the line RewriteCond %{REQUEST_FILENAME} !-d should allow me to show what was into that folder as it’s existing and having the correct permissions (user:user chmoded 755)
after having tried everything I could find on the subject, I ended up creating a .htaccess into my folder “/myfolder“
with the unique following line in it :
And I finally got http://example.com/myfolder to answer the response 200 OK
I suppose this is not the best ever solution but it’s the only one that worked for me and as I just need this to work for one or two folders, it did not need to be more adaptive / flexible