You need a vhost for the subdomain that redirects to public_html/sub_domain_folder instead of trying to redirect with .htaccess. You can then do a www redirect in public_html/sub_domain_folder/.htaccess.
There should be some option in cpanel when creating the subdomain do specify which folder it directs to if you don’t have direct access to your vhost.
Related Posts:
- Custom permalink structure with %postname% in front of domain name
- 301 Redirects for Changed Permalink Structure & Category Base
- How do I turn off 301 redirecting posts (not canonical)?
- Subdomains to pages
- Passing variables through permalink structure
- htaccess or redirect to cloak portion of a link?
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Using WP rather than .htaccess to redirect pages/posts
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- WordPress redirection problem after moving to a new server?
- Specific URL Rewriting with parameters in wordpress
- If I change permalink structures, can I use htaccess to permanantly redirect links?
- Redirect parent taxonomy to it’s child
- Need Help Correct Regular Expression Redirect Code
- Custom Permalink
- WordPress Sub domain
- Redirect a Blogger Page URL to wordpress
- Redirecting all posts after changing URL structure with htaccess
- Redirect all posts permalinks from “.html” to “/”
- WordPress 4.4 old permalink redirect
- Htaccess https 301 problem
- What causes /pages/ to appear in URI, and how to remove it?
- Some Pemalink problems, probably caused by wrong .htaccess configuration?
- Test site pages go to main site
- Comment author url link is wrong? How to change from authors/ to author/
- change WordPress permalinks and redirect new urls 301
- Configuring Home Page Address
- Can’t access WordPress site in subfolder possibly because of .htaccess redirect from root installation?
- Removed and Reinstalled WordPress, Redirect Broken now
- redirect old pages by .htaccess
- Why are all pages redirecting to homepage when using custom permalinks?
- .htaccess regex for redirect subdomain to root domain & redirect old permalinks
- 404 posts error after 301 redirection of changed category / tag base
- 301 Redirect posts to newly added categories
- How does WordPress handle permalinks?
- Mapping Domains to Permalinks (not multisite)
- Setting up WordPress with Custom Permalinks and no .htaccess File?
- Does WordPress Change the .htaccess File When Updating?
- Removing the redirect after changing a page’s slug
- Move WordPress to subdirectory, keep ALL URLs
- Permalinks to Custom does not work (out of box)
- URL rewrite based on a custom field value
- WordPress permalinks Yahoo hosting(no .htaccess allowed)
- How can I force WordPress to redirect to canonical permalinks?
- Redirect old permalinks to new permalinks
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- Htaccess for Wordpess set on single subdomain
- + Character in permalink
- WordPress on a subdirectory of Laravel – WordPress pretty permalinks inner page shows laravel
- Site redirects to wrong url when saving settings
- How can I include a query string with get_permalink
- Permalink redirection from ‘Day and name’ to ‘Post name’
- How to map permalinks with accented letters to sanitized slugs?
- Remove subfolders from URL
- Nicest way to 301 Redirect traffic when changing permalink settings
- Changing Permalinks to a Custom Permalink causes a 404 Error [no matter what I do]
- Multisite wordpress and subdomain URL collisions
- Changing pemalink structure to /%post_id%/%postname%/
- WordPress overrides the GET variables, (page_id) set in HTACCESS
- Redirect short-form URL to long-form URL (post_id to post_id + post_name)
- custom naming of search permalink /search/
- Changing URL from /%postname%/%post_id to /%category%/%postname%/%post_id%
- Using only %postname%
- removed index.php now all pages 404
- Rewriting search permalink
- Move WordPress site from one domain to another
- When using number in url it is redircting to same page but when using character it redirects to 404
- All pages lead to home
- How to create short urls for sharing and downloadable content?
- Folder Name and Category Name WordPress
- Once redirected by Rewrite rules, how can WordPress know the page?
- Redirect Pretty Permalinks to Ugly Permalinks
- WordPress permalink still not working (error or not understood?)
- customize urls displayed by previous_post_link and next_post_link
- .htaccess not working in WordPress
- Pagination is not working, how to trace it properly?
- Pretty Permalinks cause site to crash on main domain
- How do you put your own rules into .htaccess?
- Problem when i configure permalink
- 3 domains, 1 wordpress install, redirecting and changing domains on live site
- custom permlink .htaccess file 404 Not Found error
- My wordpress site must be being affected by outside sources [duplicate]
- Redirecting From An Old Permalink Structure
- Files placed in directory with wordpress 404
- 404 not found error on WordPress local host
- Add segment to URL in htaccess
- htaccess strip url
- Use .htaccess to redirect homepage to its permalink
- Pages resolve at different URLs (different capitalizations)
- Standard Htaccess directives disappear by themselves
- How to use ‘blogs.dir’ as media upload instead of ‘uploads’ directory in WordPress multisite setup
- WordPress not remembering old slugs for pages
- Changing permalink won’t redirect to new version of page
- Removing /wp in Permalink URL of subdomain led to inaccessibility to WP Dashboard
- Accidentally Changed Permalink Structure
- Forward and mask implementation not working,
- Permalinks and redirects
- Wildcard multisite wp-admin url wrongfully redirected
- Changing the URL slug causes redirecting to homepage, or showing 404 or missing lang_code issue
- Unable to access a folder that does not belong to WordPress installation