Fix WordPress Multi-Site Htaccess and Broken Images/CSS/JS
Budget: $30 – $250 USD
I'm in the process of migrating my WordPress site to a new web host. In the process, I'd like to transition my single-site WordPress installation into a multi-site one. Because the new web host is a lot more robust and I have more storage space and bandwidth, I plan to host additional sites (some WordPress and some not) under my PUBLIC_HTML directory. As such, I have my WordPress multi-site installation inside of a subdirectory so I can better keep the PUBLIC_HTML directory organized. Using the multi-site configuration, I want to set up a staging environment so I can keep updates separate from my production site.
I currently have two sites on my network:
http://www.example.com (production)
http://dev.example.com (staging)
My multi-site installation is inside of a subdirectory we will call "dir". So the file path looks like public_html/dir, public_html/dir/wp-content, public_html/dir/wp-admin, etc.
My goal is for none of the sites on my multi-site network to have the "dir" subdirectory in the URL. Everything seems to be working except for broken CSS, JS, and images on the production site (the development site looks fine so far).
I need help fixing my HTACCESS file(s) in order for this to work. In monitoring the console log in my browser, I see that a number of 404 error while trying to load the resource (CSS, JS, or image) because the path is incorrect. The site tries to retrieve files from http://www.example.com/wp-content/ but those files are not found there. The files will be found if I go to http://www.example.com/dir/wp-content directory in my browser, however, as stated, I want to hide the "dir" folder from the public user while still being able to retrieve the files. Ideally, I'd like to htaccess to be routed in a way that I can successfully retrieve the file whether or not the "dir" folder is in the URL.
I currently have two sites on my network:
http://www.example.com (production)
http://dev.example.com (staging)
My multi-site installation is inside of a subdirectory we will call "dir". So the file path looks like public_html/dir, public_html/dir/wp-content, public_html/dir/wp-admin, etc.
My goal is for none of the sites on my multi-site network to have the "dir" subdirectory in the URL. Everything seems to be working except for broken CSS, JS, and images on the production site (the development site looks fine so far).
I need help fixing my HTACCESS file(s) in order for this to work. In monitoring the console log in my browser, I see that a number of 404 error while trying to load the resource (CSS, JS, or image) because the path is incorrect. The site tries to retrieve files from http://www.example.com/wp-content/ but those files are not found there. The files will be found if I go to http://www.example.com/dir/wp-content directory in my browser, however, as stated, I want to hide the "dir" folder from the public user while still being able to retrieve the files. Ideally, I'd like to htaccess to be routed in a way that I can successfully retrieve the file whether or not the "dir" folder is in the URL.