-1

I have a wordpress multisite with 2 sites - www.example.com and www.example.com/new-site . I have been developing the new site while keeping the old one alive.

I now want to make the subdirectory subsite the main site, so when a user navigates to www.example.com - the content of www.example.com/new is shown.

What is my best way of doing this? Is it redirection ? I am hesitant to override the old site and export the site from subdirectory and import into the root directory.

Any help appreciated thanks!

annaM
  • 117
  • 9
  • Since you're hesistant to override the old site then a redirection would be best option – cnavar Aug 26 '23 at 07:15
  • I posted an answer how to redirect your /new-site to your main site. Feel free to let me know if how it went! – cnavar Aug 26 '23 at 07:23

1 Answers1

0

I suggest that you add the below to your htaccess file from the directory of your /new folder and see if it works:

RewriteEngine On 
RewriteRule ^.*$ / [R=301,L]

This one works previously. Source: implementing a 301 redirect using the htaccess file in wordpress

cnavar
  • 133
  • 5
  • I hope this helps and useful to you! – cnavar Aug 26 '23 at 07:42
  • Thanks @cnavar for your help. :) I checked the files and I only seem to have one htacess file which is in root ? – annaM Aug 26 '23 at 08:05
  • You can create a new .htaccess file for your subdirectory /new. Once created, select the newly created .htaccess file > right-click > edit. Then add the code that I added in my answer to your .htaccess file. – cnavar Aug 26 '23 at 08:16
  • You may not be using namecheap but you can use this as reference on how to create new .htaccess file for your subdirectory: https://www.namecheap.com/support/knowledgebase/article.aspx/9410/29/how-to-set-up-rules-and-redirects-in-htaccess/#redirect – cnavar Aug 26 '23 at 08:17
  • I hope that this answers your question and you find the information useful. – cnavar Aug 30 '23 at 14:23