cPanel Forums cPanel Forums

Search

By:
Advanced search…
By:
Advanced…
  • Shop our Products
    Product OverviewFeaturesAdd-onsCustomize cPanelPricingReleasesFree Trial
  • Support
  • About
    CompanyGiving BackBrand Guide
  • Pricing
  • Partners
  • Developers
Store Login
Menu
cPanel Forums cPanel Forums
  • Forums
    New posts Trending Search forums
  • What's new
    New posts New resources Latest activity
  • Resources
    Latest reviews Search resources
  • Feature Requests
Forums
Log in
Register

Search

By:
Advanced search…
By:
Advanced…
  • New posts
  • Trending
  • Search forums
Menu
  • Forums
  • cPanel & WHM® (for Linux® Servers)
  • Security

htaccess redirects for https://

  • Thread starter ckwebsystems
  • Start date Feb 13, 2011
  • Tags
    htaccess https redirects
C

ckwebsystems

Registered
Jan 30, 2011
3
0
51
Feb 13, 2011
  • #1
I need some help with htaccess on a domain with an ssl.

If someone comes to the site using:

  • http://domain.com
  • http://www.domain.com
  • https://www.domain.com

I need to have them redirected to https://domain.com and I can't figure out the correct rewrite rule to use. Basically no matter which way them get there I need them to end up at https://domain.com

Chad
 
ModServ

ModServ

Well-Known Member
Oct 17, 2006
337
5
168
Egypt
cPanel Access Level
Root Administrator
Feb 13, 2011
  • #2
Here is the rule:

HTML:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
 
Expand signature
ModServ for Hosting & Web Services Solutions
URL: http://www.modserv.com.eg
Show hidden low quality content
You must log in or register to reply here.
Share:
Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email Link
Thread starter Similar threads Forum Replies Date
A How to debug .htaccess redirects? Security 4 Dec 27, 2021
S Setting .htaccess in /var/www/html/ Security 17 Feb 1, 2021
S Cant delete infected htaccess file Security 5 Jan 19, 2021
G Comodo / DCV entries in htaccess Security 3 Mar 24, 2020
T . htaccess and htpasswd Security 2 Mar 2, 2020
Similar threads
How to debug .htaccess redirects?
Setting .htaccess in /var/www/html/
Cant delete infected htaccess file
Comodo / DCV entries in htaccess
. htaccess and htpasswd

Products & Pricing

cPanel & WHM Overview cPanel & WHM Features Extensions Customize Products cPanel & WHM Trial cPanel & WHM Releases Pricing Store Sign in

Support

Need Help? Documentation Migrations Services Ticket Support License Verification Security TSRs & CVEs

Company

About Us Giving Back Non-Profit License EDU License Brand Guide Careers Contact

Partners

Become a Partner Partner Perks Partner Directory Partner Sign in

Developers

Build for cPanel Developer Docs Application Catalog Developer License Knowledge Base Forums

Extras

News Blog cPU Certification Feature Request
  • Contact us
  • Terms and rules
  • Privacy policy
  • Help
  • RSS
Legal Notices / Privacy Policy / Transparency Policy
| Add-ons by ThemeHouse
cPanel, WebHost Manager and WHM are registered trademarks of cPanel, L.L.C. for providing its computer software that facilitates the management and configuration of Internet web servers.
Top Bottom