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?
- Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network
- How to disable Multisite sign-up page?
- WordPress multisite,several different languages,page redirect?
- Multisite – Redirect All Users to Subsite Home Page on Subsite Login
- Trying to access second site dashboard on a multisite configuration proceeds to an error
- 500 error when using virtual host
- Subfolder multisite issue. Themes and plugin files 404
- Members area with externally-managed htaccess / htpasswd authentication?
- Dissolve Multisite while making site #5 the main site?
- Disable domain redirect
- Depth > 2 possible with multisite?
- Make a user administrator to a sub directory site and a contributor to main site in multisite network
- WPMU Development Environment
- Multisite installation not in root – how to make live?
- Multiple wordpress installations that shares WordPress & Theme but with separated database
- How to set 301 redirection after moving WordPress blog?
- Redirect custom post type from one domain to another domain
- What happens if I use .htaccess of network multisite on a single site installation?
- URL redirect/rewrite rule wordpress multisite
- Nginx config, how can I redirect primary multisite domain, but not its sub-folders, nor other domains?
- Multisite Create Site not working
- How to split existing blog into WordPress Multisites without breaking links?
- How to write RewriteRule for login in multisite
- Network Admin URL is shown to anyone before accessing a blog
- Canonical Resource URLs Across a Multisite Network 2012?
- 404 redirecting to home [closed]
- Site’s admin created with wpmu_create_blog accessible only on 2nd attempt
- MULTISITE SUB-DOMAIN JUST SHOWS INDEX OF -> CGI-BIN INSTEAD OF SHOWING SITE
- How to redirect the frontend of a WordPress site (only)?
- Missing images after moving servers
- How to organize my js files
- How do I correctly configure my AMPPS localhost to use subdomains for multisite?
- Update WP install to WP network & it broke the DB connection
- How to Force WWW. in Domain With WordPress MU Domain Mapping Plugin?
- Open wordpress page in directory the way index.html would open
- Redirect a WordPress Multisite url after it has been change to a new one
- Structure of multilingual and multiregional directory listing website for translation
- Can I add a rewrite rule in htaccess to remove the multisite subdirectory from the URL?
- Using WordPress multisite for subsites only
- Redirect after login when WordPress in subdirectory
- WordPress multisite redirect one custom non www domain to www
- Multisite issue
- using htaccess to check for cookie on permalink then conditionall rewrite with query parameter
- Using multisite, how can I get two different sites on the network to have different active themes?
- Max number of sub folders
- Can’t access 2nd site (sub) dashboard of WordPress Multisite
- How do I point two urls to the same child site in a multisite config
- Multisite install in a subfolder won’t work with www
- Multisite /files/ URLs broken after server move
- Multisite installation without using domain root
- How to put a Custom Folder under one sub-site of Multisite WP?
- No input file specified after enabling multi site
- Pages redirect me to the homepage
- 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
- 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
- 404 error in dashboard of subdomain of multisite