Forums

WP Permalink rules taking over unrelated sub directories (13 posts)

  1. wm009
    Member
    Posted 4 years ago #

    Hi,

    I apologize if this has already been discussed. I can't seem to articulate the problem like everyone else would.

    Anyway, I have WP installed on the root of my domain name. I have permalinks, so the url looks nice and it works.

    Here's the deal, I installed phplist in a subdirectory and when I try to access the admin page (domain.com/phplist/admin/) I get a standard wordpress 404 page.

    I know it's some stupid little htaccess fix, but for the life of me, I just can't figure it out.

    Thanks in advance.

  2. meegwell
    Member
    Posted 3 years ago #

    I have this same issue. Appently there is a way to modify .htaccess to allow certain subdirectories to be accessed. Can anyone help out here?

  3. moshu
    Member
    Posted 3 years ago #

    meegwell,

    keep it in one single thread - don't post the same in many topics!
    Duplicate posts get deleted quickly.

  4. meegwell
    Member
    Posted 3 years ago #

    Sorry moshu. I was just surprised to see how many folks have had the same exact problem and no resolutions posted for it...and it seems that there should be a simple solution to this issue.

  5. moshu
    Member
    Posted 3 years ago #

    Those kind of errors started to appear in WP 2.3, probably due to the "canonical redirect" introduced in that version.
    Unfortunately, nobody ever bothers to read the relase notes and/or to read more about it in the links offered in #3.
    (there was even a plugin to disable it)

  6. meegwell
    Member
    Posted 3 years ago #

    Through my research I actually installed the plugin to deactivate canonical redirects.

    This did not fix the problem of accessing non-WP files in non-WP subdirectories.

  7. meegwell
    Member
    Posted 3 years ago #

    What are my other support options to resolve this?

  8. meegwell
    Member
    Posted 3 years ago #

    For others with this problem, I have recently tried this solution I found in another post:

    ADDED: Thanks to Teli's comment below, I've implemented the TPX solution (from TextPattern), and all is solved. I created a myerror.html page and, in the .htaccess, removed the above "fix" (and the fix in the index.php) and added the following:

    ErrorDocument 401 /misc/myerror.html
    ErrorDocument 403 /misc/myerror.html

    I also rebooted, which was causing my first fix above to stop working; this one works fine. Hats off to TextPattern.

    This did not work for me either.

    In a nutshell, I need to access some non-WP pages on the WP site but WP throws a 404 everytime I try to access them.

    I created a directory, TestDirectory, and a file, test.html. So along with the normal wp directories (/wp-content/ etc) there is /TestDirectory/test.html.

    When I try to access test.html, even though I know its there, I get a 404.

  9. Otto
    Tech Ninja
    Posted 3 years ago #

    I created a directory, TestDirectory, and a file, test.html. So along with the normal wp directories (/wp-content/ etc) there is /TestDirectory/test.html.

    When I try to access test.html, even though I know its there, I get a 404.

    That is not correct. WordPress's rules do not take over everything, they only take effect when the file/directory in question actually does not exist.

    What are the rules in your .htaccess file?

  10. meegwell
    Member
    Posted 3 years ago #

    thank you for the response otto. here is my .htaccess, located in the root of the site (/public_html/site/.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    note that the site is on a server with many other sites (including other wp sites). At the root of the server (public_html/) is another htaccess file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  11. moshu
    Member
    Posted 3 years ago #

    Do you have a WP install in your root (i.e. public_html), too?
    If not, why is there a WP .htaccess file?

  12. meegwell
    Member
    Posted 3 years ago #

    I do, but it is not used - I put the .htaccess in all my WP sites's roots now and was able to remove the one on the server root. I was confused for a while on the location but I worked through that.

    Still get 404s every time I try to access a non-wp file though...

  13. Otto
    Tech Ninja
    Posted 3 years ago #

    Then either one of two things is happening:
    a) your URL to that non-wp file is wrong, or
    b) you have the permissions set on that file such that apache cannot access it, and therefore cannot serve it over the web.

    Which is it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags