In my experience you don’t need to mess with .htaccess with a WordPress site. Just set the General Settings -> “WordPress Address” and “Site Address” to the preferred version (www or non www) and WordPress takes care of the redirection for you.
Related Posts:
- Place static HTML files in path below WordPress page
- htaccess rewrite for author query string when WP is in subfolder
- Remove year and month in URL using .htaccess
- Rewrite rule not working
- .htaccess redirects disappeared after re-saving permalinks
- Protect Upload Folder Files With Ampersand Problem
- Remove File Extension for Page Outside of WordPress
- WordPress URL/Folder ReWrite using Htaccess
- WordPress mod_rewrite is canceling/overwriting my other mod_rewrite rule
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- Override htacces rule only for specific directory
- mod_rewrite loop, redirecting http to https on certain section of wordpress blog
- blocking access to all post/tag URIs via htaccess
- Site in subfolder – all pages work except home
- htaccess, site and staging in subdirectories
- How to write .htaccess so that https is on for subpages only but not the home page
- How to create a redirect in the .htaccess file, with 2 exceptions
- 404 error Additionally 403 Forbidden error on a URL
- Custom rewrite rule, url returning 404
- mod_rewrite doesn’t work as I want even with JSON API Plugin disabled
- I have a page using a pretty url and a mod_rewrite rule matching it. I expected it to give an error but it’s working. Why?
- disable WordPress 404 for one specific page/folder to receive actual php errors
- How can I create a smarter .htaccess file that will add a directory?
- Rewriting subfolders to specific parent folder in WordPress
- Redirect WordPress site to a landing (construction) page using htaccess, with access to /wp-admin and /invoice
- htaccess redirect to path
- I can access subdirectory, but not files within it
- htaccess mod_rewrite not working
- Add-on domain works in WordPress but links still lead to subdomain
- Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04
- Which one does WordPress prioritize when it comes to php.ini, wp-config and .htaccess?
- htaccess problem after saving Settings
- File and directory permissions
- htaccess disable WordPress rewrite rules for folder and its contents
- htaccess https redirect from www to non-www
- Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”
- Isolating WordPress to a subfolder
- How disable SSL redirect for specific URL?
- What is the role of .htaccess file in WordPress?
- HTAccess stops me from accessing WordPress Dashboard links
- different child theme for subdomain
- How do I edit the htaccess file to optimize my website?
- Block only external access to wp-cron.php on OpenLiteSpeed
- .htaccess rewrite rule puzzle
- Site searches by Python for non-existent assets
- WordPress On subfolder
- Best way to redirect site in subdirectory to root?
- Missing slash after moving site to subfolder
- WildCard SSL with wordpress subdomain
- Why is my mod_rewrite not working?
- How To Allow Only Specific User Agent To Access a URL?
- How to ignore folder in site root while accessing a URL
- How can I enable keep alive (Not accessing to Apache)
- HTTP sitewide, except for: wp-admin, and 2 custom directories
- WordPress installed in root, need second in subdirectory with different domain
- htaccess has broken my site
- .htaccess in subdir gets ignored by WordPress’ own .htaccess in /
- TimThumb & htaccess : clean url
- Only Allow Front End Access
- How To Fix A Redirect Chain
- .htacess rewrite condition: page to seconddomain/page
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- Remove trailing slash after .html extension
- Does WP suppresses .htaccess if permalinks are disabled?
- Need help rebuilding lost htaccess file
- How do I setup htaccess for 301 redirects, post Joomla to WordPress migration? [closed]
- How to rename index.php to home.php
- Strange behaviour of is_user_logged_in() and get_current_user_id()
- Hide a subdirectory on my website hosting
- I am new in word pres my font awesome is not allow
- htaccess redirect throws an error: PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- “Oops.” error on an html file directly uploaded to a subdirectory of my WordPress site
- WordPress permalinks confusion
- How do I make WordPress revise an .htaccess file a certain way?
- Sub domain URL slash / missing after domain and before Post & page slug
- Problem with WordPress permalinks
- Basic Auth .htaccess on wp-login, but allow logout from woocommerce
- Why my WordPress Site Asking for HTTP Authentication?
- I need to make one folder private
- htaccess redirects invalid request to home page not 404
- Force HTTPS for mapped domain pointing to wordpress domain
- WordPress How to rewrite URL for custom pages
- How can I restrict access, by IP, to the `wp-admin` folder/Dashboard?
- How to properly give WordPress its own directory
- WordPress permalinks is wrong. It wants me to change my htaccess file. But then site crashes
- How to move wordpress website from hosting account to localhost
- Question with .htaccess and wp-login.php prevention
- After changing permalink, getting 404 for one particular category
- WordPress RSS feed to external XML
- Does htaccess password keep search engines out?
- Pretty permalinks (again)
- htaccess old php pages to new wordpress ones
- different CNAME to corresponding subfolders
- block seacrh engines for all pages EXCEPT homepage
- Allowing access to certain WordPress created pages or posts with htaccess / htpasswd
- Problem with All in one WP Migration – only works the home page
- htaccess – Server Subdirectory With Different Name Than URL Subdirectory
- How can I stop WordPress from catching URL’s for static pages that I save on my server
- Add rewrite endpoint and .htaccess
- .htaccess seems to be required but I can not find it