Friday , December 20 2024

How to host Wp site in a separate folder of the domain

This article is about moving a site to an internal folder of another site.

1. Transfer site files to a new folder.

2. Export the database, in the dump change the old domain to the new one (with the folder name).
For example, newdomainname.com/folder (Important! Do not put a slash at the end, you need just change olddomainname.com to newdomainname.com/folder and that’s it!)

Import the modified dump into an empty database. If it is not possible to make changes to the dump locally, upload the old dump to the server and recursively replace the old domain with the new one (with the folder name).

3. Edit the wp-config.php file, enter new data: database name, username, password for the database and the connection host.

4. Edit .htaccess, there you need to make 2 edits, according to this example:

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

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section

I tried solutions with functions that should remove from head and , but a very …

Leave a Reply

Your email address will not be published. Required fields are marked *