0

I have an installation of WordPress that has a directory containing a number of XML files. Up until this morning - those files were all accessible via the browser (I could browse directly to them). But now - trying to call them directly from the browser returns a 404 error.

I'm baffled, because nothing should have changed. I'm assuming it's an .htaccess issue most likely?

Here's my htaccess:

 <Files xmlrpc.php>
 <IfModule !mod_authz_core.c>
 order deny,allow
 deny from all
 allow from xx.xx.xx.xx
 allow from xx.xx.xx.xx
 </IfModule>
 <IfModule mod_authz_core.c>
 Require ip xx.xx.xx.xx xx.xx.xx.xx
 </IfModule>
 </Files>
 # END GOTMLS Patch to Block XMLRPC Access
 # 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

(note - obscured relevant IP addresses)

What am I missing?

1 Answer 1

1

If 404 error display then htaccess file is wrong. just change htaccess code from your to my code.

if your files are in folder like www.xyz.com/foldername/ therefor use following code.

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

# END WordPress

if your files is directly on server like www.xyz.com therefor use following code

# 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

this code for main htaccess file which is in main directory where wp-config file is available and another htaccess is in wp-content folder. Make another .htaccess file in wp-cotent folder and write following code.

#<FilesMatch "\.(?i:php)$">
#  <IfModule !mod_authz_core.c>
#    Order allow,deny
#    Deny from all
#  </IfModule>
#  <IfModule mod_authz_core.c>
#    Require all denied
#  </IfModule>
#</FilesMatch>

after this check your wp-admin and it will not display 404 error.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.