The site has fairly complex functionality, and uses various form handling scripts to interact with external API's etc

Until very recently, these scripts were working fine having followed other advice on here on how to prevent WordPress hijacking the request (as it loves to throw 404's rather than access the scripts)

Current State

For whatever reason, these techniques with htaccess etc stopped work and in desperation the WordPress installation has been moved into it's own subdirectory using the instructions in the Codex

After removing some additional htaccess that was causing issues, all the pages load. However /wp-admin/ now always returns 404 (after redirecting to the new location at /wordpress/wp-admin/.

The new website root structure goes like this:

/-- public_html
    /-- wordpress
        /-- wp-admin
        /-- wp-content
        /-- etc...
    /-- processors
        /-- script-name.php

As suggested in the codex, only index.php was changed and there are two .htaccess files that are identical in public_html and public_html/wordpress.

# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /

 # My attempt to prevent wordpress hijacking the processors directory
 RewriteCond %{REQUEST_URI} !^/processors/$

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
# END WordPress

I can't seem to get either wp-admin to work or the processors directory.

I've tried turning rewrites off in each directory with a seperate .htaccess file, as well as various custom rewrite rules.

Any suggestions, directions to investigate appreciated. It's very possibly my lack of .htaccess skill is showing

  • This is not at all WordPress related, your issue is entirely .htaccess related. – Fayaz Jan 18 '17 at 1:36
  • htaccess is a core part of WordPress functionality, and this use case is common enough the WordPress codex covers it. If I were using pure php functionality to do a task related to WordPress (such as calling a wp function for input then struggling there after) would your help be to tell me it's not wordpress but php? – Solflux Jan 18 '17 at 8:46
  • The reason I said this is because according to the policy of this site, these sort of questions are usually deleted because they are not specific to WordPress. Please check the "not specific to WordPress" section here: wordpress.stackexchange.com/help/on-topic – Fayaz Jan 18 '17 at 9:03
  • Note: /wp-admin/ will rightly return 404, since you've removed it to /wordpress/wp-admin/, so you'll have to access your wordpress admin panel using link like: your-site.com/wordpress/wp-admin – Fayaz Jan 18 '17 at 9:05
  • Also I didn't answer the question because I'll have to explain a lot of things & may be eventually this question will be deleted. So better if you ask this question in ServerFault: serverfault.com – Fayaz Jan 18 '17 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.