Migrate wordpress to a directory

0

I am trying to place a wordpress installation to a folder, instead of having it in the root of the domain. I make the migration without problem from mydomain.com to mydomain.com/folder The problem I have to point the domain to the folder for the user to access from mydomain.com, the front has no problem, but when accessing the backoffice method user and password, when sending, refresaca and clean the form without giving error message or anything like that.

The process has been: Migrate the installation to a folder and check that everything worked ok. Place a .htaccess file in the root with the following code

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?midominio.com$
RewriteCond %{REQUEST_URI} !^/carpeta/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /carpeta/$1
RewriteCond %{HTTP_HOST} ^(www.)?midominio.com$
RewriteRule ^(/)?$carpeta/index.php [L]

So in the root I have the .htaccess and the folder with the wordpress installation.

I do not know if I should do more configurations and / or where

Thanks in advance

    
asked by user9092634 13.02.2018 в 17:03
source

2 answers

1

With that code for the .htaccess it gives an error 403.

Right now I have it with the file in the root I had and in the database the $ prefix table. "_options", the "home" and "siteurl" records have the real path type

link

I have access to the backoffice without problem.

In principle, this works ok, in case someone comes up with this solution.

    
answered by 15.02.2018 / 13:36
source
0

Try the following code for the htaccess, replace the folder with the name of the directory you put in.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /carpeta/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /carpeta/index.php [L]
</IfModule>
    
answered by 13.02.2018 в 17:37