Close Menu
    What's Hot

    Leading Search Engine Optimization Company in Hyderabad!

    April 2, 2024

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024
    Facebook X (Twitter) Instagram
    Webliance.com
    • Home
    • Categories
      1. Digital Marketing
        • Google Ads
        • Lead generation
      2. Brand Promotion
        • Brand Promotion video
        • Brand Website
        • Brochure
      3. Content Management
      4. Corporate Business Email
      5. Website Development
        • Corporate Website
        • landing Page
        • Logo Designing
      6. Social Media Ads
        • Reels and Post
        • Social media marketing
        • Voice Calls
      7. WhatsApp Marketing
      8. YouTube Video Promotions
      Featured
      Recent

      Leading Search Engine Optimization Company in Hyderabad!

      April 2, 2024

      Best e-commerce website development company in Hyderabad

      March 31, 2024

      SEO Copywriting: Crafting Content that Ranks and Converts

      March 29, 2024
    • About Us
    • Services
      • SEO
      • Web Development
      • Web Design
      • Social Media Marketing
    • Portfolio
    • Contact Us
    Facebook X (Twitter) Instagram
    Webliance.com
    Webliance Pvt Ltd

    How to redirect HTTP to HTTPS Using .htaccess

    webliance.comBy webliance.comMay 6, 2023No Comments2 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email

    Editing .htaccess File

    There are instructions/directives in the .htaccess file that tell the server how to act in certain scenarios and directly affects how your website functions. Common directives in .htaccess file:

    • Redirects
    • Rewriting URLs

    Ways to edit an .htaccess file:

    1. Edit the file on your computer and upload it to the server using FTP.
    2. Use “Edit” mode in FTP program that allows you to edit a file remotely.
    3. Use a text editor and SSH to edit the file.
    4. Use the File Manager in cPanel to edit the file.

    Editing .htaccess in cPanel File Manager

    Note: Backup your website in case something goes wrong.

    1. Login to cPanel
    2. Files > File Manager > Document Root for:
    3. Now select the domain name you want to access
    4. Check “Show Hidden Files (dotfiles)”
    5. Click “Go”
    6. After a new tab or window opens, look for the .htaccess file.
    7. Right click on the .htaccess file and click on “Code Edit” on the menu.
    8. A dialogue box may pop up asking about encoding. Click “Edit” button to continue.
    9. Edit the file
    10. “Save Changes” when done.
    11. Test your website to make sure it is done correctly. In case, there is an error, restore to the previous version and try again.
    12. Once you are done, click “Close” to close the window.

    Redirecting HTTP to HTTPS

    1. Redirect All Web Traffic

    If you have existing code in your .htaccess, add the following:

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

    2. Redirect Only a Specific Domain

    For redirecting a specific domain to use HTTPS, add the following:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

    3. Redirect Only a Specific Folder

    Redirecting to HTTPS on a specific folder, add the following:

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteCond %{REQUEST_URI} folder
    RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]

    Note: Replace “yourdomain” with your actual domain name wherever required. Also, in case of the folder, replace /folder with the actual folder name.

    Think it was helpful? Share this article to help others come on HTTPS.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleIntroducing Offsite Backups with SnapShooter on Cloudways
    Next Article What is ERR_CONNECTION_TIMED_OUT Error, and How to Fix it?
    webliance.com
    • Website

    Related Posts

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024

    SEO for Educational Institutions

    March 27, 2024

    Beat 10 Most Successful Advanced Showcasing Procedures For Instructive Institutions

    March 21, 2024

    2023’s Most Influential Digital Agency Coaches to Follow

    October 17, 2023

    The Best PHP Framework in 2023?

    October 16, 2023

    Contact Us

    Office Address:

    #301 Vamshi millenium
    Yousufguda Check Post, Hyderabad, 500045

    Call us on:
    +91 8977 149 318

    Email us on:
    info@webliance.com

    Categories
    • Analytics (4)
    • Blog (96)
    • Brand Promotion video (2)
    • casino (6)
    • Content Management (1)
    • Digital Marketing (96)
    • Editor's Choice (1)
    • Featured (49)
    • Featured Reviews (7)
    • Opencart (1)
    • SEO (80)
    • SEO Marketing (25)
    • Social (3)
    • Social Media Ads (1)
    • Social media marketing (5)
    • Top Picks (3)
    • Trending (4)
    • Videos (11)
    • Webliance Pvt Ltd (259)
    • Website Development (45)
    • Youtube (2)
    • YouTube Video Promotions (2)
    Top Reviews
    Editors Picks

    Leading Search Engine Optimization Company in Hyderabad!

    April 2, 2024

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024

    SEO for Educational Institutions

    March 27, 2024

    We are progressive digital marketing organization in Hyderabad serving a extensive variety of on-line marketing and Branding services like SEO, SEM, SMO

    Email Us: info@webliance.com
    Contact: +91 8977 149 318

    Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn WhatsApp
    Our Picks

    Leading Search Engine Optimization Company in Hyderabad!

    April 2, 2024

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024
    Categories
    • Analytics
    • Blog
    • Brand Promotion video
    • casino
    • Content Management
    • Digital Marketing
    • Editor's Choice
    • Featured
    • Featured Reviews
    • Opencart
    • SEO
    • SEO Marketing
    • Social
    • Social Media Ads
    • Social media marketing
    • Top Picks
    • Trending
    • Videos
    • Webliance Pvt Ltd
    • Website Development
    • Youtube
    • YouTube Video Promotions
    © 2025 webliance.com. Designed by Webliance Pvt Ltd.
    • Home

    Type above and press Enter to search. Press Esc to cancel.