Support » Localhost Installs » Invalid post type in backend – due to bad URL generated

Viewing 9 replies - 1 through 9 (of 9 total)
  • Joy

    (@joyously)

    Can you install the Health Check plugin and use the Troubleshoot mode to disable plugins/theme for your user only? This should isolate the problem code.
    It is likely some code that defines a post type or rewrite rules.

    Thread Starter szenko

    (@szenko)

    I have noticed this after moving site to new server.
    I thought that maybe something went wrong when I was moving the site.

    After that I did a new fresh install of WP without any plugin running just “Twenty Twenty” theme.
    The problem still presists
    Again in bad url:
    “/wp-admin/edit.php?post_type=page%3Fpost_type%3Dpage”

    This is .htaccess file

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    I need to go live with new site but I’m stuck with this URL “error”
    As I said, everything works OK except this thing with bad URL on post_type.

    Thank you for any new advice.
    S.

    • This reply was modified 3 weeks, 2 days ago by szenko.

    What happens after you have published these pages? Do the links work then?

    Pages are not sequential like posts are – so there isn’t a “next page” (only a next post).
    Pages are hierarchical.

    Of course, it is possible that we are not understanding what exactly you’re asking (because it is difficult to draw a picture in your mind of something you can’t see), but it does sound like you have a plugin (or possibly a theme?) enabled that is causing unexpected behaviour.

    Joy

    (@joyously)

    Your initial description mentioned both ‘post_type=page” and ‘post_type=product’.
    The first one is built in, but the second one means you are using a plugin.
    Was your “new fresh install of WP without any plugin running just “Twenty Twenty” theme” on the same server? Does your server force install any plugins or cache? Do you have any browser extensions that might be affecting the URL?

    I checked my 5.7 test site and I don’t see this issue. I also tried it on this sandbox https://wpsandbox.net/ and didn’t see the issue.

    Thread Starter szenko

    (@szenko)

    @joyously
    Sorry for this confusion with links, I have pasted wrong link. Should be “post_type=page”.

    The second one “post_type=product” is from plugin.

    But behaving is the same on both “post_type”-s

    Because of that I did a fresh install. I have noticed the same situation where only wordpress is installed without any other plugin. In this case just “post_type=page”
    Yes server is the same.

    No extensions are installed in browser.

    I was checking also the server, but I didn’t find any bad configuration for now.

    I have found another case of this problem, but without clear solution
    Link

    Joy

    (@joyously)

    That link says the answer is server configuration, with mod_security specified. Since it’s not in your .htaccess file, it’s further up the chain.
    If you can’t find it, ask your host where to look.

    Thread Starter szenko

    (@szenko)

    I disabled mod_security. (a2dismod security2)

    I enabled it some time ago because I wanted to change “servername” in “response headers” (to custom name)

    Actually in the link above was explained exactly this 🙂

    It seems that this is causing a problem….

    Thanks for the enlightenment. 😉
    S.

    Thread Starter szenko

    (@szenko)

    My question would be now, if it is possible to use simultaneously ModSecurity and wordpress and to avoid an error(issue) that I have explained before?

    Alan Fuller

    (@alanfuller)

    ModSecurity is successfully used with WordPress installs on many hosts.

    I would guess by your response that you are managing your own server or VPS.

    Normally is is a process of identifying the ModSec rule and disabling it.

    I’m not an expert in this area, perhaps another will be along or ask a server expert forum.

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