• Resolved dersime37

    (@dersime37)


    Hey guys, after setting up the custom wp-admin with an option to disable default one I’am getting 404 error on new url.

    .htaccess:

    RewriteCond %{REQUEST_URI} /panel$
    RewriteRule ^(.*)$ /panel/ [R=301,L]
    RewriteRule ^panel(.*) /wp-admin$1 [L,QSA]
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^wp-admin(.+) /index.php?wph-throw-404 [L]
    • This topic was modified 6 years, 1 month ago by dersime37.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Maya

    (@tdgu)

    Hi,
    This should work fine, the lines might get in conflict with other rewrite code or a server environment block this to run as expected.

    Can you manually change the above code to the following:

    #RewriteCond %{REQUEST_URI} /panel$
    #RewriteRule ^(.*)$ /panel/ [R=301,L]
    RewriteRule ^panel(.*) /wp-admin$1 [L,QSA]
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^wp-admin(.+) /index.php?wph-throw-404 [L]

    Thanks

    Thread Starter dersime37

    (@dersime37)

    Thank you for fast reply.

    Unfortunately commenting out two first lines changed nothing. Still 404 on /panel. I guess because /panel pointing to /wp-admin and /wp-admin redirects to 404, am I wrong?

    Im not using any other plugin, or rewrite rules for that feature.

    • This reply was modified 6 years, 1 month ago by dersime37.
    Plugin Contributor Maya

    (@tdgu)

    Hi,
    Actually that’s the purpose of this line RewriteCond %{ENV:REDIRECT_STATUS} ^$ it checks for internal redirect before block the default admin.

    If you update the lines to the following, does it works for you?

    RewriteCond %{REQUEST_URI} /panel$
    RewriteRule ^(.*)$ /panel/ [R=301,L]
    RewriteRule ^panel(.*) /wp-admin$1 [L,QSA]
    #RewriteCond %{ENV:REDIRECT_STATUS} ^$
    #RewriteRule ^wp-admin(.+) /index.php?wph-throw-404 [L]
    Thread Starter dersime37

    (@dersime37)

    Yes it works, but then old link is accessible, it’s like the “Disable default url” turned off.

    Plugin Contributor Maya

    (@tdgu)

    It must be caused by the server, for some reason the last 2 rewrite lines are not processed as expected. If you contact us directly I’ll check it further.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘404 – wp-admin rewritten with disabled default’ is closed to new replies.