WordPress htaccess not working with subdirectory install

I moved my wordpress site to a new server- copy/paste the contents.

Now on the server there is a structure: public_html/myinstall

Read More

In “myinstall” there is wordpress.

In any case I cannot get to work, that accessing root domain would show the wordpress content.

I tried (among other) this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/myinstall/(.*)$ 
RewriteRule ^.*$ - [L]
</IfModule>

I also tried to copy/paste the htaccess from previous server but does not work.

I managed to fix it, i made a typo in the subdirectory :/ sorry to waste your time

RewriteEngine on
RewriteCond %{HTTP_HOST} ^myinstall$ [NC,OR]
RewriteCond %{HTTP_HOST} ^myinstall$
RewriteCond %{REQUEST_URI} !myinstall/
RewriteRule (.*) /myinstall/$1 [L]

# 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

Is this structure of htaccess ok?

Related posts

Leave a Reply