htaccess lässt sich nicht ändern

  • Hallo,

    ich kann über FTP meine htaccess lokal herunterladen, ändern und wieder in das urspr. Verzeichnis hochladen.
    Zunächst wird mir (über Yoast SEO) auch die Änderung darin angezeigt, aber kurze Zeit später ist sie wieder weg.
    Ich vermute, es liegt an einem Plugin, weiß aber nicht welches.

    Hat jemand eine Idee?
    Pat

    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

  • Hallo,

    welche Dateirechte hat die .htaccess Datei?

    LG

    644 hat sie laut Filezilla, wie auch wp-config.php und alle anderen einzelnen Dateien, der Besitzer hat Lesen, Schreinen, aber nicht Ausführen.
    Die Verzeichnisse haben 755.

    Einmal editiert, zuletzt von bat2.111 (25. März 2017 um 18:35)

  • Hallo,

    Das ist die Standard Berechtigung und sollte daher passen.
    Ich erkenne hier keinerlei Plugin, welches das bearbeiten / überschreiben der .htaccess übernehmen könnte. Kenne aber auch nicht jedes verwendete Plugin.

    Könntest Du einmal den Inhalt der .htaccess hier posten?

    LG

  • # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  • Dieser Eintrag ist auch "Standard". Um welchen Inhalt möchtest Du die Datei für Yoast erweitern?

    Verstehe im Moment nicht, wieso Yoast einen "speziellen" .htaccess Inhalt benötigt.

    LG

    Einmal editiert, zuletzt von FloRet (25. März 2017 um 18:47)

  • Yoast braucht keine Erweiterung. Ich sehe mir außerhalb von Filezilla nur mit Yoast die htaccess an.

    Das hier soll drinstehen:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>


    <ifModule mod_headers.c>
    Header set Connection keep-alive
    </ifModule>

    <IfModule mod_deflate.c>
    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/atom_xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-shockwave-flash
    </IfModule>

    <IfModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </IfModule>

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType text/html "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType application/xhtml-xml "access plus 600 seconds"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
    </IfModule>

    <ifmodule mod_headers.c>
    <filesmatch "\\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
    </filesmatch>
    <filesmatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
    </filesmatch>
    <filesmatch "\\.(js)$">
    Header set Cache-Control "max-age=604800, private"
    </filesmatch>
    <filesmatch "\\.(x?html?|php)$">
    Header set Cache-Control "max-age=600, private, must-revalidate"
    </filesmatch>
    </ifmodule>

    <IfModule mod_headers.c>
    Header append Vary Accept-Encoding
    </IfModule>

    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]

    RewriteEngine On
    RewriteBase /

    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule (.*) https://%%7bhttp_host%7d/%241 [R=301,L]

    # END WordPress

  • Hallo,

    ok - ich sehe gerade das WP Cerber so eine Art Sicherheitsplugin für Wordpress ist.

    Das könnte Dein Problem auslösen - versuche es einmal für testzwecke zu deaktivieren und die Änderungen noch einmal durchzuführen.
    Oder gibt es innerhalb des Plugins eine Einstellmöglichkeit, welche die .htaccess betrifft?

    LG

  • Hallo,

    ok - ich sehe gerade das WP Cerber so eine Art Sicherheitsplugin für Wordpress ist.

    Das könnte Dein Problem auslösen - versuche es einmal für testzwecke zu deaktivieren und die Änderungen noch einmal durchzuführen.
    Oder gibt es innerhalb des Plugins eine Einstellmöglichkeit, welche die .htaccess betrifft?

    LG


    Ich habe nun die Schreibrechte der htaccess rausgenommen und nun bleibt der Ihnalt so, wie er sein soll.
    Ja, in Yoast kann man die htaccess direkt bearbeiten.

  • WP versucht immer wenn du in den Permalink Einstellungen bist, die .htaccess neu zu schreiben und ersetzt dann alles zwischen BEGIN und END.

    [size=10]Bitte immer zuerst die Forensuche nutzen und erst danach Deine Fragen hier im Forum stellen, denn sehr vieles wurde schon mehrfach beantwortet. Bitte dabei auch die Forenregeln beachten.
    Kein Support per PN - Fragen gehören ins Forum.[/SIZE]
    [size=8]Wenn du eine weise Antwort verlangst, musst du vernünftig fragen. (Johann Wolfgang von Goethe)[/SIZE]

  • WP versucht immer wenn du in den Permalink Einstellungen bist, die .htaccess neu zu schreiben und ersetzt dann alles zwischen BEGIN und END.

    Okay, immer wenn ich in 'einstellungen'-'permalinks' bin, wird die htaccess neu auf den Standardeintrag gesetzt?

  • Hallo,

    nur wenn Du die Permalinks-Einstellungen änderst - speicherst, wird der Inhalt zwischen BEGIN Wordpress und END Wordpress überschrieben.

    Habe dies nicht beachtet.

    Also in Zukunft immer ##BEGIN WORDPRESS## - ##END WORDPRESS## und dann erst # CUSTOM Anpassungen #.

    Verständlich?

    LG

  • Ah, ein Licht geht auf! :D
    Ich habe mich die ganze Zeit gewundert, warum die htaccess immer wieder den Standardinhalt anzeigen.

    Also eigentlich dann so:

    # BEGIN WordPress
    Standardinhalt

    # END WordPress

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


    <ifModule mod_headers.c>
    Header set Connection keep-alive
    </ifModule>

    <IfModule mod_deflate.c>
    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/atom_xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-shockwave-flash
    </IfModule>

    <IfModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </IfModule>

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType text/html "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType application/xhtml-xml "access plus 600 seconds"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
    </IfModule>

    <ifmodule mod_headers.c>
    <filesmatch "\\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
    </filesmatch>
    <filesmatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
    </filesmatch>
    <filesmatch "\\.(js)$">
    Header set Cache-Control "max-age=604800, private"
    </filesmatch>
    <filesmatch "\\.(x?html?|php)$">
    Header set Cache-Control "max-age=600, private, must-revalidate"
    </filesmatch>
    </ifmodule>

    <IfModule mod_headers.c>
    Header append Vary Accept-Encoding
    </IfModule>

    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%%7bhttp_host%7d/%241 [L,R=301]

    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%%7bhttp_host%7d/%241 [L,R=301]

    Einmal editiert, zuletzt von bat2.111 (26. März 2017 um 14:37)

  • Habe ich eben probiert - konnte dann den Server nicht mehr erreichen.

    Irgendwas habe ich falsch gemacht.

    htaccess Umleitung auf www

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    # BEGIN Custom

    <ifModule mod_headers.c>
    Header set Connection keep-alive
    </ifModule>

    <IfModule mod_deflate.c>
    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/atom_xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-shockwave-flash
    </IfModule>

    <IfModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </IfModule>

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType text/html "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType application/xhtml-xml "access plus 600 seconds"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
    </IfModule>

    <ifmodule mod_headers.c>
    <filesmatch "\\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
    </filesmatch>
    <filesmatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
    </filesmatch>
    <filesmatch "\\.(js)$">
    Header set Cache-Control "max-age=604800, private"
    </filesmatch>
    <filesmatch "\\.(x?html?|php)$">
    Header set Cache-Control "max-age=600, private, must-revalidate"
    </filesmatch>
    </ifmodule>

    <IfModule mod_headers.c>
    Header append Vary Accept-Encoding
    </IfModule>

    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%%7bhttp_host%7d/%241 [L,R=301]

    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%%7bhttp_host%7d/%241 [L,R=301]

    # END Custom

  • Hallo,

    da ist die ein- oder andere tiefgreifende "Optimierung / Einstellung" dabei z.B. Connection Keep-alive, welche Dein Problem nachvollziehen lassen. Scheinbar unterstützt Dein Webhostingpaket gewisse Anpassungen via htaccess nicht.

    LG

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!