anna1334
Verfasste Forenbeiträge
-
Forum: Installation
Als Antwort auf: Probleme mit 404-Error-Seite / Umleitungen von .php URLs (htaccess?)Ah, jetzt gehts. Vielen Dank! 🙂
Falls jemand anderes hier landet mit einem ähnlichen Problem:
- WordPress Multisite kann falsche .php URLs offenbar einfach nicht (via Backend / Plugin / …) umleiten, dh es ist nicht eine falsche Einstellung bei mir <- das hab ich nicht gleich kapiert 😉
- Lösung:
in der .htaccess oben drauf eine Liste einfügen mit allen Umleitungen, circa:Redirect 301 /alt-link1.php https://meinurl.com/neu-link-eins
Redirect 301 /alt-link2.php https://meinurl.com/neu-link-zwei
Forum: Installation
Als Antwort auf: Probleme mit 404-Error-Seite / Umleitungen von .php URLs (htaccess?)Ich meinte Notlösung, weil es umständlich erscheint ~50 php-Dateien als einzelne Weiterleitungen zu machen. Wäre einfach schöner, wenn die Fehlermeldung es bis ins wordpress schaffen. 😉
Hier die .htaccess – siehst du etwas das geändert werden sollte?
# BEGIN GzipWpFastestCache <IfModule mod_deflate.c> AddType x-font/woff .woff AddType x-font/ttf .ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE x-font/ttf AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf </IfModule> # END GzipWpFastestCache # BEGIN LBCWpFastestCache <FilesMatch "\.(webm|ogg|mp4|ico|pdf|flv|avif|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|otf|ttf|svg|eot)(\.gz)?$"> <IfModule mod_expires.c> AddType application/font-woff2 .woff2 AddType application/x-font-opentype .otf ExpiresActive On ExpiresDefault A0 ExpiresByType video/webm A10368000 ExpiresByType video/ogg A10368000 ExpiresByType video/mp4 A10368000 ExpiresByType image/avif A10368000 ExpiresByType image/webp A10368000 ExpiresByType image/gif A10368000 ExpiresByType image/png A10368000 ExpiresByType image/jpg A10368000 ExpiresByType image/jpeg A10368000 ExpiresByType image/ico A10368000 ExpiresByType image/svg+xml A10368000 ExpiresByType text/css A10368000 ExpiresByType text/javascript A10368000 ExpiresByType application/javascript A10368000 ExpiresByType application/x-javascript A10368000 ExpiresByType application/font-woff2 A10368000 ExpiresByType application/x-font-opentype A10368000 ExpiresByType application/x-font-truetype A10368000 </IfModule> <IfModule mod_headers.c> Header set Expires "max-age=A10368000, public" Header unset ETag Header set Connection keep-alive FileETag None </IfModule> </FilesMatch> # END LBCWpFastestCache # BEGIN WordPress Multisite # Using subfolder network type: https://wordpress.org/support/article/htaccess/#multisite RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] # END WordPress Multisite
Forum: Installation
Als Antwort auf: Probleme mit 404-Error-Seite / Umleitungen von .php URLs (htaccess?)Hi,
danke für die Antwort!
Wenn alte-seite.php so wie andere inexistente Seiten behandelt werden würde und die User auf index.php landen (bzw. auf der eigenen Error-404 Seite) wäre das ja schonmal etwas. Genau das funktioniert aber eben nicht – es kommt die kahle Fehlermeldung „File not found.“ wie im Screenshot.Am liebsten wäre mir dies über einen Plugin im Backend zu lösen (zB Rankmath, bin aber offen für Empfehlungen) – also dort Weiterleitungen anzugeben und zu verwalten. Das klappt aber mit keinem URL der auf .php endet.
Siehe zB. http://www.writersstudio.at/alte-seite.php vs. http://www.writersstudio.at/alte-seite (beide existieren nicht, aber der Fehler sieht ganz anders aus).Als Notlösung kann ich natürlich einzelne PHP-Weiterleitungs-Seiten machen und hochladen – aber gibt es da keine elegantere / einfachere Lösung?