• cc2024

    (@cc2024)


    Hello,

    after changing the “Site Address (URL)” at settings when trying to publish a new post or page an error-message comes:

    Publishing failed. The response is not a valid JSON response.

    Is it because of my .htaccess-file, because of Require User there, because of wordpress, …? What do I have to change?

    The domain is situated at the hosting-company in the file-directory:

    /mydifferentdomains/example_com

    The directory

    /mydifferentdomains/example_com/section

    is secured by an .htaccess-file per “Require user”.

    At settings in my WordPress-Settings page:

    WordPress Address (URL)
    https://www.example.com/section/wp

    Site Address (URL)
    https://www.example.com/section/wp

    There I change the Site Address (URL) to auf https://www.example.com

    After the change the .htaccess-file reads:

     
    RewriteEngine On
    #Options FollowSymLinks
    ErrorDocument 404 default
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    
    ErrorDocument 404 default
    # ErrorDocument 404 /neuanlegen.php?aktion=DateiNichtVorhanden
    
    # Next three lines by the hosting company, after I activated the SSL-certificate coming with my contract.
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <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>
    
    # END WordPress
    

    But now whenever trying to “Publish” a new post or page the error-message comes up:

    “Publishing failed. The response is not a valid JSON response.”

    —–

    (Once I accomplished this I will switch the setting to use Permalinks..)

    • This topic was modified 8 months ago by cc2024.
    • This topic was modified 8 months ago by cc2024.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter cc2024

    (@cc2024)

    The Debug information showed:

    The Rest-API encountered an unexpected result:

    REST-API-Endpunkt: https://www.example.com/section/wp/wp-json/wp/v2/types/post?context=edit
    REST-API-Antwort: (300) Multiple Choices

    Thread Starter cc2024

    (@cc2024)

    When using Classic Editor Plugin the publishing seemingly works, but calling the page then shows the server error:

    Multiple Choices

    The document name you requested (/index.php) could not be found on this server. However, we found documents with names similar to the one you requested.

    Available documents:

    Please consider informing the owner of the referring page https://www.example.com/section/wp/wp-admin/post.php?post=22&action=edit about the broken link.

    • This reply was modified 8 months ago by cc2024.
    Moderator bcworkz

    (@bcworkz)

    Did you move your WP installation to public root for example.com, or is it still at /mydifferentdomains/example_com/section/wp/?

    Depending on what else was done aside from changing settings either approach could work. Try visiting your permalinks settings screen. No need to change anything, just load the screen. This will cause the rewrite rules to be regenerated.

    What’s odd is your site/home settings are for http://www.example.com, yet the API path is still example.com/section/wp/wp-json/wp/v2/types/post/. The /section/wp/ part should no longer be there. Regenerating rewrite rules might correct this.

    If you did not move your WP installation, you need to direct example.com requests directly to your WP installation through your domain’s configuration settings in your hosting account.

    Thread Starter cc2024

    (@cc2024)

    The wp installation is still at the subdirectory.

    For generating the English error message and seeing the English dashboard menu texts I already removed the wp generated htaccess-changes first.

    But I will try it again, this time first moving elsewhere any other old file by myself I still have in the
    /mydifferentdomains/example_com/
    directory, so that the automatic generating system of wp can work on a blank “/mydifferentdomains/example_com/ “-directory and subdirectories, installed where it is now in the subdirectory, and the subdirectory protected by the htaccess Require user.

    Once I have tried that I will report back. 🙂

    • This reply was modified 8 months ago by cc2024.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing Site Address leads to error-message when publishing. Using htauth-direc’ is closed to new replies.