• At superpersis.nl we have a great situation at hand. Nothing changed and all of the sudden my customer gives me a call that he’s unable to login using wp-admin. Obviously I’m on to it and I got the same error: 404 Page not found.

    I experienced this before with older versions and usually deleting .htaccess does the trick and so it this this time. After a couple of days the problem reoccurred and I deleted .htaccess again. Unfortunately after some time – a couple of hours later I double checked and it showed the same error.

    For almost a week I’m trying to fix this and the website is in maintenance mode. Customer unhappy and I’m unhappy as I’m doing him a favour. I’ve read really a lot of topics on the forum and tried almost every option handed to me. This is what it comes down to and it doesn’t matter if I use a clean install (WP 4.4) or DB import (PHP 5.5.30), with plugins (Askimet, Contact Form 7 Datepicker, Fast Secure Contact Form, PDF Embedder, Robo Maps, WP Date Range) or without, standard theme (Twenty Sixteen) or personalised theme (Firmness), subfolder or root:

    When using the standard permalinks (superpersis.nl/?123) I’m able to log in using wp-admin. When using superpersis.nl/%postname% I cant log in.

    In the mean time I reinstalled WP into a subfolder and I’m intending to keep it like that.

    I seriously need some help with this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I experienced this before with older versions and usually deleting .htaccess does the trick and so it this this time. After a couple of days the problem reoccurred and I deleted .htaccess again. Unfortunately after some time – a couple of hours later I double checked and it showed the same error.

    When using the standard permalinks (superpersis.nl/?123) I’m able to log in using wp-admin. When using superpersis.nl/%postname% I cant log in.

    Your topic isn’t a WordPress problem, it’s something wrong with your installation that does that. A stock WordPress installation will never do that unless there’s a problem with how your permalinks are setup.

    When using the standard permalinks (superpersis.nl/?123) I’m able to log in using wp-admin. When using superpersis.nl/%postname% I cant log in.

    Can you reproduce that and show us the link were that happens? It sounds like something is taking precedence over your .htaccess file. Seeing that would help sort out your problem.

    Thread Starter speessie

    (@speessie)

    Thank you for your reply Jan, I appreciate that!

    Your reply made me reconsider my words after first being really annoyed that you said it didn’t happen with a clean install, which it did. I wanted to proof you wrong (read: proof me right) and installed WP 4.4 in a sub folder of one of my websites. After entering the DB information etc. the installation didn’t progress. So I checked with FileZilla to edit the config file. It was correct. I checked the original WP install and it was identical to the new install. It scared the sh*t out of me as I lost my website! So I restored a backup and all was well. That’s when it hit me: you were right! It’s not the regular install which shows this error, it’s an install in a sub folder.

    There for I thank you for taking me/us a step closer to a solution. The problem still occurs though.

    Why are pretty permalinks not working when WP is installed in a sub folder?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Why are pretty permalinks not working when WP is installed in a sub folder?

    They do work, they always have. There’s something going on with your installation. ??

    I’ll use a test installation at this URL running WordPress 4.4 and Twenty Sixteen as an example.

    https://dixie.dembowski.net/wordpress/

    Except for the Wapuuvatar plugin, I have no plugins activated. It’s a straight test installation with the theme unit test data.

    The pretty permalinks and logging in via /wp-admin/ (redirects to the login page) or /wp-login.php work fine for me.

    Here’s my .htaccess file that WordPress generated.

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

    Except for modifying my server’s Apache2 config file with these lines

    <Directory /var/www/html>
                    Options -Indexes
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>

    I’ve not made any other changes. The AllowOverride All lets mod_rewrite do its work.

    What’s in your subdirectory .htaccess file? Is there one in the root directory? Does your Apache2 configuration have anything like above?

    Thread Starter speessie

    (@speessie)

    Hiya Jan,

    Currently the .htaccess in the subfolder of jthosting.nl looks like this:

    # Block the wp-config file.
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>
    
    # Block the include-only files.
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]
    
    # 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

    And in the root like this:

    # 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

    The root .htaccess file of Superpersis.nl currently looks like this because of the standard option for permalinks: /?p=123 or something like that.

    # BEGIN WordPress
    
    # END WordPress

    The subfolder .htaccess looks like this:

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

    The Apache2 config file is on the same (shared) server and I could not find but I ask my registrar if ModRewrite is on and he confirmed this. Should I also ask him about the content of the config file?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    The root .htaccess file of Superpersis.nl currently looks like this because of the standard option for permalinks: /?p=123 or something like that.

    Let’s focus on this one just to limit the different testing and trial and error.

    *Visits https://www.superpersis.nl/winkel/ and looks*

    Okay, that’s different.

    From https://www.superpersis.nl/winkel/ I clicked on this link -> https://www.superpersis.nl/?p=667 Normally it’s all within a sub-directory so https://www.superpersis.nl/?p=667 would be https://www.superpersis.nl/winkel/?p=667

    Now I have some questions. ??

    1. Where is WordPress installed on the file system? It looks like you may have in a subdirectory /winkel/ but the post redirects to the root.

    2. Does /winkel/ exist as an actual subdirectory?

    3. When I visited https://www.superpersis.nl/winkel/wp-admin/ I was greeted with an interesting login prompt. Where’s that coming from? If it is server based then there may be more going on here.

    4. What do you have in your WordPress SiteURL and WordPress Address? I think it’s these two values

    https://www.superpersis.nl/winkel
    https://www.superpersis.nl

    But I want to confirm the rest. I can reproduce the WordPress parts on my test site but the host part might be a problem for me.

    Thread Starter speessie

    (@speessie)

    That’s a fast one Jan!

    To answer your questions one by one:
    1. Where is WordPress installed on the file system? It looks like you may have in a subdirectory /winkel/ but the post redirects to the root.
    1) it is in root/winkel.
    2. Does /winkel/ exist as an actual subdirectory?
    2) It actually exists as a subdirectory (created it myself).
    3. When I visited https://www.superpersis.nl/winkel/wp-admin/ I was greeted with an interesting login prompt. Where's that coming from? If it is server based then there may be more going on here.
    3) If you are referring to the WordPress attack protection; I was under the impression it came with WordPress? It is for sure server based. As WordPress was under attack quite often by hackers who used “Admin” and some random passwords to hack a site I could imagine that a registrar would like to rule out hacker software. It happened to me at my previous host btw, cost me quite some time…
    4. What do you have in your WordPress SiteURL and WordPress Address? I think it's these two values
    4) You are absolutely right about the two values.

    So what does this tell us?

    P.s. Winkel = Dutch for shop.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pretty permalinks (%postname%) block wp-admin(login)’ is closed to new replies.