You’re close.
I added a few more places to capture more scenarios and used the HTTP_HOST variable in the rule. The $1
is not needed in the condition as that would match what’s captured in the above condition.
<IfModule mod_rewrite.c>
RewriteEngine On
Rewritecond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteCond %{REQUEST_URI} ^/subsite/? [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
</IfModule>
I recommend Made With Love’s .htaccess check to verify your testing.
Related Posts:
- Working with Reverse Proxies and Multisite Installation
- External rewrite rules missing in htaccess – Multisite
- Moving a WP Multisite to a subdirectory
- WordPress Multisite – Multiple subfolders for blogs
- WordPress multisite subdirectory redirect infinite loop issue
- multisite htaccess 301 redirects
- W3 Total Cache Plugin with WP 3 MultiUser [closed]
- Domain redirect in WordPress multisite
- Suppress subdirectory from WordPress Multisite primary URL
- Why wordpress multisite redirect to wp-signup if site exists?
- Sub-subdomain getting redirected to main domain
- How to exclude a directory from WordPress permalinks in a Multisite environment?
- Redirect subdomain homepage to domain specific page in wordpress multisite
- WordPress multisite subdirectory on nginx behind reverse proxy
- Multisite Redirect issue
- How to disable the default WordPress redirect to non-www URLs?
- Redirect subdomain in Multisite installation?
- Issue with htaccess redirection in WP Multisite
- Why my deleted url is redirecting to random post?
- Redirect only posts to New Domain
- Temp URL Redirect Loop
- Wrong Redirect/Rewrite Rules?
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- URL without www redirect directly with submission page – Multiwordpress install
- Multisite Redirection to new domains
- Multisite Subdirectory with same domain subdomain
- Redirect old uploads after moving to multisite
- WordPress: how to change URL for individual MultiSites?
- How to host unrelated pages on WordPress domain
- Multisite Subdomain Redirect Mask
- Cannot use Network Admin (Dashboard) on Multi-site after 301 www redirect
- 301 Redirection After Comment
- Redirect Function Prevents Images from Showing in Front-end Media Uploader
- multisite 404 subfolder same name slug as site
- How to make the redirects right? IP to domain name folders
- WordPress Multisite redirect loop
- Multisite, different domains, optional subdirectory, and htaccess
- WP Multisite .htaccess interferes with cgi-bin
- Redirect extra url to Multisite in folder
- How can I set up a completely separate (not multisite) WordPress installation as a subdirectory of an existing WordPress blog?
- The wp-admin url for each site does not work on WordPress multisite
- Site Redirecting to wp-signup.php
- Redirect Main Site to Subsite in Multisite WordPress
- Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
- multisite 404 error for subdirectory
- Multisite htaccess on localhost with WP as an SVN external?
- Multisite in subfolder – How to make new sites to be in same level subfolders as the main site
- Multisite install in a subfolder won’t work with www
- WordPress Multisite subdomains and sharing the same upload folder
- WordPress Multisite with thousands of blog
- Multisite /files/ URLs broken after server move
- How To Change the URL of a WordPress Multisite
- Multisite login and redirect to users main blog,
- Nested folder paths for WordPress multisite
- Subdirectory and domain multisite installation
- Installed in root, want second in subdirectory
- Redirect all users, except network administrators, from the main site to a subsite
- Multisite: Redirect Subsite Administrator to Subsite Home Page, Bypassing Dashboard
- Admin user getting redirected to /wp-admin/user
- Make a select where the options are the different multisites
- Multisite installation without using domain root
- Primary site file uploads failing, subdirectory subsites upload fine
- How to redirect author subdomain pages to each author pages on www
- Is there a way to have wordpress 301 versus 302 urls by default?
- How to put a Custom Folder under one sub-site of Multisite WP?
- Multisite move server giving redirect loop
- No input file specified after enabling multi site
- Pages redirect me to the homepage
- How do I make a copy of WordPress to other folder
- Redirect WordPress MS to no-www version, excepting some dirs and prefixes
- How do I combine wp_redirect and add_filter?
- Multisite redirect loop for a single www domain
- Development (multi)site indexed – recommendations to redirect 301 to correct url?
- Redirect authors from upload.php url to Home page in Multisite
- Nginx Multisite redirects (incorrectly) on Chrome IE and Mobile, but works (correctly) on Firefox
- Permalinks in Multisite not working
- How to redirect root blog to a specific one in multilang WP?
- WordPress 3.0 Multisite – Child sites and backends appearing blank
- Is it possible to install a different wordpress installation in a subdirectory? [duplicate]
- Multisite subdirectory blogs missing slash
- Nice font not working when http to https – SSL Issue
- Subdomain add comment redirect to 404 not found page iis server
- Multisite website configure Domain issue
- Moved WP Multisite, cannot access sites
- Multi site root site installed on subdomain, with child sites as subdirectories
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error
- 404 error in dashboard of subdomain of multisite
- Multisite Primary Domain Broken All Subsites Work
- Make multisite non-existing subdomains go to homepage instead of Index of/ page
- Wp-admin wrongly redirecting on multisite
- WordPress multisite with subdomains behind nginx reverse proxy using subdirectories
- WordPress multisite with different sites for every language. How can I set the site based on the users browser location or language?
- Show 404 when someone visits a non-existant Multisite site
- Best way to set up multiple urls for the same WordPress site?
- WordPress: How to change name of ADD-ON domain’s folder and also change/rename all references to it
- GCP & WordPress: Domain redirecting to external ip instead
- Change WordPress Multisite Domain to subfolder
- How to approach prefixing the path of a multisite sub-directory install?
- phpmyadmin not working with wordpress multisite subdirectory
- Multisite redirect