RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
Same as Michael’s except this one works 😛
Related Posts:
- htaccess – Redirect to subfolder without changing browser URL
- How to remove wordpress directory slash
- How to remove .html from URL?
- How to remove .html from URL?
- .htaccess Remove WWW from URL + Directories
- Safely redirect old WordPress blog links to new WP blog
- Masking wp-content/themes/name/images to just images directory using htaccess
- Making a plugin file accessible via url rewrite?
- How to change default page slug?
- How to map permalinks with accented letters to sanitized slugs?
- Removing rules from .htaccess
- Sub domain redirection to taxonomy
- How to? Redirect /category/sci-fi/ to /category/scifi/?
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Redirecting all old links from previous EE site to new WP site in one go?
- Server (WordPress) redirects files that are not supposed to (using htaccess)
- Rewrite WordPress Custom URL
- Using WP rather than .htaccess to redirect pages/posts
- Custom rewrite rule
- Menu links only using http after enabling https, unable to redirect http links
- How to create a 301 redirect that doesn’t apply to subsites
- Why does multisite bypass WordPress for wp-content, wp-admin, wp-includes and .php files?
- Alias ‘wp-content’ directory to something shorter (framework?)
- Rewrite rule to load images from production does nothing
- Remove base slug in permalinks of hierarchical custom post type
- How to disable the default WordPress redirect to non-www URLs?
- WordPress rewrite rules don’t need ^?
- Why is my mod_rewrite not working?
- add_rewrite_rule fro html to another url not working
- Adding rewrite rules directly to .htaccess file
- Double domain name in category URL-s
- .htaccess rule to redirect old URLs to new structure [closed]
- Rewrite Preview URL to include index.php
- a one-off rewrite rule
- How to configure Multisite Network with randomized hostnames?
- Change htaccess to redirect to index.php in subfolder
- Wrong Redirect/Rewrite Rules?
- Wildcard forward all posts and pages with few exceptions
- Redirections and rewrites to subdomain
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- How To Fix A Redirect Chain
- Redirect a Blogger Page URL to wordpress
- Map secondary domain to other’s virtual subfolder
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- Redirecting /px/?q=x to /px/x/
- URL redirect on updating the post date
- Redirect – remove custom query string
- Rewrite vs Redirect from ?p={ID}
- mod-rewrite exception? keep #hash in matching urls?
- Is WordPress API visible from PHP file called in htaccess
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- Redirect htaccess [closed]
- force www rewrite if wordpress put in a folder
- 301 Rewriting htaccess
- 404 redirect based on url
- Custom permalink structure with %postname% in front of domain name
- How do I make WordPress revise an .htaccess file a certain way?
- Understanding Redirects
- Pretty URL via Rewrite
- URL Rewrite 404
- Fresh install redirects to www, breaking page loads
- Cannot get 301 redirection in htaccess to work (either Redirect or Rewrite)
- WordPress Category url redirects to subdomain
- htaccess and redirect to new url using regex
- ModRewrite not working properly
- Redirect A URL Pattern In WordPress Using .htaccess
- Migration from old CMS to WordPress 301 redirection rules?
- WordPress on a subfolder but accessible from root
- Changes done to .htaccess are not getting reverted back
- Can’t get pretty permalinks to work without index.php
- How to redirect a virtual page (e.g. /blog) to the home page?
- Add rewrite endpoint and .htaccess
- Post pages are redirecting to the 404 page in wordpress
- Allow requests to resources outside the wordpress folder
- CodeIgniter removing index.php from url
- Wrong canonical link on wp-admin pages
- Hijacking the URL for filtering
- Multisite wordpress and subdomain URL collisions
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- Two “.htaccess” Files Located in Different Directories?
- Using a custom field value to redirect away from a 404 page
- Evaluating a external rewrite rule before internal wordpress rewrite rule
- WWW to non WWW redirect effects on load speed
- Change links automatically to affiliate links
- Redirect home to another page with htaccess
- 301 Redirect Loop
- .htaccess Redirect
- Preserve Domain Alias
- Built-In Postname Redirection vs Hard Redirects in relation to SEO and performance
- redirect automatic page that serves custom posttype content
- Image URLs not redirecting properly
- 301 Redirect Old URL to New WordPress Page
- 404 error Additionally 403 Forbidden error on a URL
- URL masking of subdomain to main domain using .htaccess
- htaccess rewrite, adding segment to url
- Permalinks do not include www subdomain
- How to rewrite wordpress search to work on specific category
- Rewrite rule and display of post
- Stop wordpress to redirecting home page if no page found
- How to rewrite URL using .htaccess in WordPress Plugin