www to non www with https
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
More Related Contents:
- How can I use .htaccess rewrite to redirect root URL to subdirectory?
- ReWrite rule to add .html extension
- Force HTTPS for specific URL
- Rewrite URL after redirecting 404 error htaccess
- How to do htaccess redirect based on cookie value
- Add Trailing Slash .htaccess
- Need to redirect all traffic to https
- Redirect .php URLs to URLs without extension [duplicate]
- .htaccess to redirect images
- Best Practice: 301 Redirect HTTP to HTTPS (Standard Domain)
- .htaccess redirect – automatically add www. if no subdomain exists
- .htaccess URL redirect
- .htaccess redirect without changing address bar
- 301 redirect .htaccess
- 301 redirect from URL with query string to new domain with different query string
- .htaccess redirect
- Using regular expression in htaccess for 301 redirects
- Redirect all http AND https non-www URLS to https://www.xyz.com via htaccess
- .htaccess redirect to all IP’s but mine
- Deny all, allow only one IP through htaccess
- Block all bots/crawlers/spiders for a special directory with htaccess
- How to get MAMP to read .htaccess files
- apache redirect http to https and www to non www
- How can I redirect to a different domain without changing the URL in the address bar?
- Issue In Removing Double Or More Slashes From URL By .htaccess
- ‘hash’ url rewrite in .htaccess
- Preserve HTTP/HTTPS protocol in .htaccess redirects
- Make web root folder a sub-folder with .htaccess?
- .htaccess rewrite URL with a question mark “?”
- .htaccess – Redirect subdomain to folder