Support » Installation » Permalinks

  • Uwe

    (@uweportugal)


    Hallo zusammen,
    es wäre schön hier Hilfe zu bekommen.

    Problem:
    bis Anfang des Jahres (am 09.01.22 habe ich einen Beitrag hinzugefügt) hat meine Webseite noch bestens funktioniert.
    Seit einiger Zeit wird nur noch die Startseite angezeigt und alle anderen Links führen zur 404 Fehlerseite.
    Im Moment funktioniert die meisten Seitenaufrufe nur, weil ich die Permalinkstruktur von “Beitragsname” auf “Einfach” umgestellt habe.

    Die Webseite besteht aus einem Hauptverzeichnis und einem Unterverzeichnis.
    Das Hauptverzeichnis und das Unterverzeichnis haben jeweils eine eigene WordPressinstallation.

    Die Installation im Hauptverzeichnis “https://wandern-mit-uwe.de/” bereitet keine Probleme.
    Der Aufruf der Startseite im Unterverzeichnis “https://wandern-mit-uwe.de/blog/” funktioniert auch noch. Wenn man jedoch einen Link zu einem Beitrag anklickt, dann erscheint die 404 Fehlerseite.

    Bei Werkzeuge -> Webseite-Zustand im Statusbericht steht:
    Der Aufruf der REST-API führte zu folgendem unerwarteten Ergebnis: (404)

    Meine bisherigen Versuche das Problem zu beheben:
    WP-Optimize war dabei deaktiviert und vorher wurden die Caches geleert.
    a) Alle Plugins deaktiviert, auf das aktuelle WP-Theme 20-21 umgestellt und Permalinks auf Beitragsname gespeichert.
    b) htaccess-Datei gelöscht und danach Permalinks auf Beitragsname gespeichert.
    c) Support vom Hoster angeschrieben, mit der Antwort das es technisch nicht mehr möglich ist eine WP-Installation im Unterverzeichnis zu haben und ich sollte auf Subdomaine umstellen. Diese Antwort erscheint mir nicht korrekt zu sein.
    d) In der functions.php habe ich testweise diesen Code eingefügt:
    add_filter(‘rest_enabled’, ‘_return_false’);
    add_filter(‘rest_jsonp_enabled’, ‘_return_false’);

    Kann mir bitte jemand helfen das Problem zu lösen?

    Hier die .htaccess Datei vom Blog, wenn die Permalinks auf Beitragsname eingestellt ist:

    # BEGIN WordPress
    # Die Anweisungen (Zeilen) zwischen „BEGIN WordPress“ und „END WordPress“ sind
    # dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
    # Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /blog/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    # END WordPress

    Header always unset „X-Powered-By“

    ## EXPIRES CACHING ##
    # BEGIN Expire headers
    <ifModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/x-icon „access plus 1 year“
    ExpiresByType image/jpeg „access plus 1 year“
    ExpiresByType image/jpg „access plus 1 year“
    ExpiresByType image/webp „access plus 1 year“
    ExpiresByType image/png „access plus 1 year“
    ExpiresByType image/gif „access plus 1 year“
    ExpiresByType image/svg+xml „access plus 1 month“
    ExpiresByType application/x-font-ttf „access plus 1 year“
    ExpiresByType application/x-font-truetype „access plus 1 year“
    ExpiresByType application/x-font-opentype „access plus 1 year“
    ExpiresByType application/x-font-woff „access plus 1 year“
    ExpiresByType application/font-woff2 „access plus 1 year“
    ExpiresByType application/vnd.ms-fontobject „access plus 1 year“
    ExpiresByType application/font-sfnt „access plus 1 year“
    ExpiresByType application/x-shockwave-flash „access plus 1 year“
    ExpiresByType text/css „access plus 1 month“
    ExpiresByType text/javascript „access plus 1 month“
    ExpiresByType application/javascript „access plus 1 month“
    ExpiresByType application/x-javascript „access plus 1 month“
    ExpiresByType text/html „access plus 4 hours“
    ExpiresByType application/xhtml+xml „access plus 4 hours“
    ExpiresDefault „access 28 days“
    </ifModule>

    <IfModule mod_headers.c>
    <filesMatch „\.(ico|jpe?g|png|gif|webp|swf)$“>
    Header set Cache-Control „public“
    </filesMatch>
    <filesMatch „\.(css)$“>
    Header set Cache-Control „public“
    </filesMatch>
    <filesMatch „\.(js)$“>
    Header set Cache-Control „private“
    </filesMatch>
    <filesMatch „\.(x?html?|php)$“>
    Header set Cache-Control „private, must-revalidate“
    </filesMatch>
    </IfModule>

    # END Expire headers

    # BEGINN CACHIFY
    # GZIP FILE

    RewriteCond %{REQUEST_URI} /$
    RewriteCond %{REQUEST_URI} !^/wp-admin/.*
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =““
    RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html.gz [L]

    AddType text/html .gz
    AddEncoding gzip .gz

    # HTML FILE
    RewriteCond %{REQUEST_URI} /$
    RewriteCond %{REQUEST_URI} !^/wp-admin/.*
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =““
    RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html -f
    RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}%{REQUEST_URI}index.html [L]

    # END CACHIFY

    # mod_deflate aktivieren
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/vtt
    AddOutputFilterByType DEFLATE text/x-component
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/js
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/atom+xml
    AddOutputFilterByType DEFLATE application/json
    AddOutputFilterByType DEFLATE application/ld+json
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/font-woff2
    AddOutputFilterByType DEFLATE application/x-font-woff
    AddOutputFilterByType DEFLATE application/x-web-app-manifest+json font/woff
    AddOutputFilterByType DEFLATE font/woff
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    </IfModule>

    # END mod_deflate aktivieren

    # Disk-Cache aktivieren
    <IfModule mod_disk_cache.c>
    CacheEnable disk /
    CacheRoot „/var/cache/mod_proxy“
    </IfModule>

    # END Disk-Cache aktivieren

    # Wordfence WAF
    <Files „.user.ini“>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Files>

    # END Wordfence WAF

    # BEGIN FRedirect_ErrorDocument
    # Die Anweisungen (Zeilen) zwischen „BEGIN FRedirect_ErrorDocument“ und „END FRedirect_ErrorDocument“ sind
    # dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
    # Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
    ErrorDocument 404 /blog/index.php?error=404
    # END FRedirect_ErrorDocument

    Die Seite, für die ich Hilfe brauche: [Anmelden, um den Link zu sehen]

  • Das Thema „Permalinks“ ist für neue Antworten geschlossen.