Support » Fixing WordPress » Permalink Change Generated a 403

  • ericroks

    (@ericroks)


    Hello all,

    I am building a fresh WP site on my server using a subdomain (migrate.hartfordrents.com/wp-login.php). I was having trouble with Pages not being able to be saved and found a forum (https://wordpress.org/support/topic/updating-failed-while-trying-to-edit-pages/) that advised me to change my permalink settings to Plain. I had it set to Post Name.

    I hit save.

    And now the entire site is generating a 403 forbidden error. I cannot even access the login page.

    I have gone through the steps most forums provide like:

    1) delete htaccess and refresh.
    2) check permissions: folders – 755 files – 644.
    3) added:

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # Fix 403 errors on existing directories; WordPress overrides.
    RewriteCond %{REQUEST_URI} ^/(wordpress)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . /index.php [L]

    # END WordPress

    to the top of the htaccess.

    Yet none of this has worked and I am still locked out of my site. Has anyone encountered this in the past or have any insight as to how this can be sorted out so that I can access this site again?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • the permalinks are stored in the database.

    Take a look here https://www.narga.net/how-to-solve-403-forbidden-wordpress-permalink-clash-folder-name/

    ericroks

    (@ericroks)

    Thanks for the reply.

    I had previously found that article and added:

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # Fix 403 errors on existing directories; WordPress overrides.
    RewriteCond %{REQUEST_URI} ^/(wordpress)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule . /index.php [L]

    # END WordPress

    To the top of my htaccess file with no success.

    • This reply was modified 1 month ago by ericroks. Reason: formatting
    Joy

    (@joyously)

    Yeah, that [L} on the end of the line means “Last”, so it likely doesn’t even get to your new lines.

    You could edit the option table to change the permalink option back again.

    ericroks

    (@ericroks)

    I am sorry, Joy, I am not familiar… where can I find the “option table”?

    Joy

    (@joyously)

    In your host control panel, there is typically phpMyAdmin and you can manipulate the database directly.
    You might need to do some research to figure out what the name of the option is and what it should be set to.

    ericroks

    (@ericroks)

    I was able to find wp_options in the AQL database and it was a blank field. I checked up on it and, it appears that blank is the default setting.

    Yet, the 403 still persists.

    I then found this (https://wordpress.stackexchange.com/questions/58625/where-is-permalink-info-stored-in-database) and added the following into “permalink_structure”:

    [(.?.+?)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2]
    [(.?.+?)/comment-page-([0-9]{1,})/?$] => index.php?pagename=$matches[1]&cpage=$matches[2]
    [(.?.+?)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2]

    …still no luck.

    • This reply was modified 1 month ago by ericroks. Reason: formatting
    ericroks

    (@ericroks)

    Update:

    I was chatting with my hosting provider and they found a very small error that was easy to overlook.

    The .htaccess file was missing the “dot” at the beginning of the filename.

    It would appear that when I saved the changed Permalink settings, the subsequent .htaccess regeneration by WP forgot to add the “dot” before the “htaccess”. This may have something to do with the fact that it is a beta/dev site on a subdomain, but that is just a hypothesis.

    This caused the entire site (front & back-ends) to generate a 403 (and a 500 in some cases).

    I hope this information helps others in the future.

    Thank you for your responses & cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.