Redirection Code

Discussion in 'Software' started by Steffy Jose, Sep 11, 2017.

  1. Steffy Jose

    Steffy Jose Private E-2

    Hi friends, recently i have change my website URL from Http to Https. The problem is my website is loading for both the version. How to redirect Http to Https. My preferred version is Https.
     
  2. Anon-469e6fb48c

    Anon-469e6fb48c Anonymized

  3. Philipp

    Philipp Administrator Staff Member

    Is the server running Apache? Then add the following code to your .htaccess file:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    </IfModule>
    
    If you have no .htaccess file, just create the file with the code above and upload it to your webspace.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds