• Hi everyone,

    So here is my problem.

    When i’m trying to enter in one of my sub-site admin, wordpress is changing my htaccess, and after that, i’ve got an internal server error on all my multisite installation. This behaviour was caused by trying to change the permalink structure for that sub-site.

    If i come back to the old permalink structure by manually changing the htaccess, i can access the other sub-sites (front and admin), but everytime i try to access problematicsubsite/wp-admin, wp is writing a wrong htaccess again. Below is the wrong htaccess wp is writing.

    Thnaks for your help.

    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]# BEGIN WordPress
    ErrorDocument 404 /index.php?error=404
    # END WordPress
    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]
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ouranos2

    (@ouranos2)

    I tried something, without really knowing what i was doing. It seemed to work. I manually revert to the standard multisite htaccess and I just put my htaccess to 444 – not writeable – . After that i could enter in my problematic sub-site admin and i changed the permalink structure. I went back to 664 for my htaccess, and all seems ok.
    I didn’t understand what happened though, if anybody could enlight me …

    thanks.

    I do not believe WP core alters your .htaccess file for you. However there are a number of plugins that may. A theme could do it too, though that would not be as common.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wordpress is writing incorrect htaccess when i'm trying to connect to wp-admin’ is closed to new replies.