Support » Networking WordPress » Permalink Change Breaks Site After Install

  • Resolved accreativeservices

    (@accreativeservices)


    Permalink Issue

    I have created a sub-domain, sub.mysite.com. I want my permalinks structure to be post name: sub.mysite.com/about. I am installing the current version of WordPress

    Our primary domain is set to “postname”. It works just fine. I wanted to set-up the sub-domain the same way.

    However, when I install WordPress in the subdomain, my permalinks are set to “Custom Structure” and look like this: /index.php/%year%/%monthnum%/%day%/%postname%/

    I did not set that up, it is how it was when I first opened permalinks.

    So I changed it to Post name, which is what I want and saved.

    Issue:

    Now when I create a new page I get this error message: Publishing failed. The response is not a valid JSON response.

    I cannot publish the page.

    How do I correct this issue? Please explain simply, I’m new at this. Thanks for any help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@t-p)

    The response is not a valid JSON response

    It may be a lot of different things:
    – a plugin conflict either 1) a plugin doing something that creates output, thus breaking the response or 2) a plugin doing something with caching),
    – an overloaded server,
    – misconfigured http/https address in General Settings,
    – blocking rules on your server
    – permalinks may need resetting,
    – theme/plugin conflict,

    check Site Health: From your WordPress dashboard, if you go to Tools and then select Site Health, then under the Status tab on that page, WordPress will show you any improvement recommendations that could help your website. An issue related to Rest API could also cause the JSON response error on your website. Moreover, if you find any issue there, solving the issue might also fix the JSON response error for your website, etc.

    Also review https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-invalid-json-error-in-wordpress-beginners-guide/ ; https://wordpress.org/support/topic/json-blocks-posts-with-optional-permalinks/?view=all

    Thread Starter accreativeservices

    (@accreativeservices)

    Hello, thank you for the reply. Here are my answers:
    1. This is a new install and I have no plugins active.
    2. I have no idea about the server (I mostly just do front end stuff)
    3. Http settings are normal
    4. Blocking rules? No idea.
    5. Permalinks need resetting. How?
    6. Theme is Twenty Twenty-Three. So basic.

    This is my third day trying to resolve this issue. We have a main domain and this is a sub domain. We have other sub domains that work just fine. Do sub domains get their own .htaccess file?

    I set up a link on the home page. The URL of the linked page looks like this: https://sub_domain.main_domain.com/index.php/page2/. It is referencing “index.php” for some reason.

    We have a main domain and this is a sub domain. We have other sub domains that work just fine. Do sub domains get their own .htaccess file?

    If this is a stand-alone WordPress site, then, yes, the subdomain site will and should have its own rewrite rules, which would typically be in a .htaccess file if you’re running the Apache webserver (or a drop-in Apache alternative like LiteSpeed).

    If this subdomain site is a Multisite subsite, then, no, the subdomains are virtual: they don’t have their own root directory, and they don’t have their own .htaccess files.

    I set up a link on the home page. The URL of the linked page looks like this: https://sub_domain.main_domain.com/index.php/page2/. It is referencing “index.php” for some reason.

    That may be atypical, but correct nonetheless, and is an artefact of your webserver’s configuration. See Almost Pretty Permalink.

    In most cases, you can simply remove the index.php/ prefix, save the permalinks, and the full pretty permalinks should work.

    Note that the permalinks should work even with the index.php/. If this is not working for you, then the problem lies somewhere else, and simply removing this prefix isn’t going to do jack.

    Are you able to provide the subdomain site address so I can take a peek?

    (NB: note that this is a public support forum, and anything you share publicly will remain public ever after.)

    Standing by.

    Thread Starter accreativeservices

    (@accreativeservices)

    This issue has been resolved by my ISP. Here is the message I received, I’m not sure what it means but it worked:

    WordPress administration is strictly out of scope.  

    Nginx does not use .htaccess file. This feature is exclusive to Apache, which your server does not seem to be using. I have made a backup of the /etc/nginx/plesk.conf.d/vhostsguides.air-care.com.conf that controls the website behavior, and changed it so that it is the same as /etc/nginx/plesk.conf.d/vhostsair-care.com.conf. I then restarted nginx, please check if this has made any difference.

    Moderator t-p

    (@t-p)

    Glad its sorted 🙂

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