Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
25% Recurring Discount on NVMe VPS
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

.htaccess redirect help

bikegremlinbikegremlin Member
edited August 2019 in Tutorials

Yes, I've googled, found different solutions/advice, so though to ask here. I thought it is a routine ruleset to be implemented. But posting the question on another forum (WHT) didn't provide any help. Anyway:

For WordPress websites (if that is relevant) I'd like to use .htaccess rules to enforce the following redirections:

1)
Main domain:

All visits to either:
http://www.example.com
http://example.com
https://example.com

should be redirected to:
https://www.example.com

Including any "trailing" stuff, of course, like:
http://www.example.com/about/ to https://www.example.com/about/

2)
Sub-domain (placed on a separate cPanel account if that info is important)

All visits to either:
http://sub.example.com
http://www.sub.example.com

should be redirected to:
https://sub.example.com

Also including any "trailing" path additions.

Comments

Sign In or Register to comment.