I refer to this question previously asked and not suitably answered:
WordPress overriding actual subdirectories
and also
Non “WordPress” pages/code getting 404 error
I have the same problem and I have tried nearly everything I found on the net. It’s definitely related to having permalinks turned on in the wordpress.
However, I have put a new .htaccess file in the subdirectory with:
RewriteEngine off
and the problem still exists. Even if I completely delete the wordpress .htaccess file the problem still exists.
I have also tried some other suggested solutions such as
ErrorDocument 401 “Unauthorized access”
and
ErrorDocument 404 “Unauthorized access”
and
Redirect 301 /mysubdirectory http://www.mydomain.com/mysubdirectory/index.html
in various locations all to no avail.
Can someone please offer another solution?
The only way I can fix it is to turn permalinks off but we need them to be on.
Thanks,
Nicole
I’m assuming that you put WordPress in your site root and the external directories are also in your site root. The reason this is happening is that .htaccess files follow a hierarchy. Whatever directives are in the top-level .htaccess file flow down and apply to all directories below it.
If this is the case, you can do one of several things:
Move your WordPress into its own directory.
See: http://codex.wordpress.org/Moving_WordPress
If you move WordPress into its own directory so that it is on the same level in your server directory hierarchy as the other directories the WordPress rewrite rules cannot affect the other directories.
RewriteEngine Off – this would normally work. If it isn’t working check that you are not using a wildcard DNS setting. If you have a wildcard * hostname record pointing at your web server in your DNS settings it can cause havoc with .htaccess and subdomains.
In the .htaccess file in your site root, add the following ABOVE the WordPress .htaccess directives:
One of these should work for you.
This has worked for me in the past for a similar situation :
Put this on top of
.htaccess
when i copy my files into the same server but with different subdirectory folder so when i tried to access my pages, index.php is working fine but the other pages are not and giving me a 404 error. Sorry for my bad english!!
I just look into my htaccess the original:
and put the new one with
I see this thread is a few months old, but just in case you never got it to work!
I had a similar issue, but my problem was that the wordpress install was located in the subdirectory which prevented URL access to folders within the root (outside the WP install directory), but only when permalinks were enabled. To solve this, I copied both index.php and .htaccess (copy not move) from the subdirectory where the WP install is located and placed them both in the root public_html (or whatever subdirectory that you’re trying to access outside the WP install directory). The .htaccess file has the rewrite conditions for permalinks already:
Enable permalinks for refresh and it solved all issues. Make sure your permissions for the root folders are set correctly too as this has caused me problems in the past.
If you are still getting 404’s with the htaccess disabled and you have verified the paths and you know the files are there then your only options left are these three…
Options…
If none of that works then you need a new host.
After nearly plucking my hair editing the htaccess I finally found a solution that will work for WordPress.
I had this problem after installing a codeiginter script on the same root directory that WordPress is installed.
After trying all the tricks listed here I was still getting 404 errors on the pages associated with the new script.
I noted that the WordPress htaccess was overiding the script’s htaccess. I also noted that other WordPress installations in the same directory did not have this 404 error.
I simply adopted the htaccess from the new WordPress installation in the same server directory and added it in the folder where my script is located. Here is how it looks like :
Replace subdirectoryname with the name of your directory and place this htaccess file inside the folder where your script is located.
Example : If the site is installed here
public_html/
and the new folder is located
copy the htaccess above and save it inside the folder ‘example’ and this should work.
I’ve looked at the responses here a number of times as I’d run into a similar problem. I have files in a subdirectory that would throw a 404 error when I tried to access them. All the .htaccess stuff failed to rectify it, as Kirsten Douglas says, WordPress does the job already.
My solution
I found this article after checking the error_log on the server. I was getting a message about wrong uid for scripts. I also noticed that the 404 wasn’t being thrown because of the file, but because the server couldn’t serve up a 500.html file i.e. I had a 500 error.
Turns out I’d created files as root, and needed to change ownership to the webfiles owner.
I hope this helps others who’ve had the same issue!
You should be able to just add a
RewriteCond
directive that will make sure the WordPress rules are ignored for requests inside your subfolder.However, you say that even with no WordPress
.htaccess
you’re experiencing the problem? What’s the contents of your subdirectory.htaccess
?