To redirect the URL addresses of your domain from HTTP to HTTPS, add the following code at beginning in the .htaccess file.
- It is a 301 redirect, good for SEO.
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Make URL address without www

If you also want to make all the URL addresses of your website without www, add the following code in .htaccess.
- Replace "domain_name" with the name of your domain.
RewriteCond %{HTTP_HOST} ^www.domain_name.net
RewriteRule ^(.*)$ https\:\/\/domain_name.net\/$1 [R=301,L]
- Make sure that the links in the pages of your website are with the New Address.

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add definition lists into a <dl> element?
<dt> <dd> <li>
<dl>
 <dt>HTML</dt>
  <dd> - Hyper Text Markup Language</dd>
  <dd> - Language for web pages</dd>
</dl>
Which CSS property can hide an element on page, letting an empty space in its place?
display position visibility
#id {
  visibility: hidden;
}
Click on the event which is triggered when the mouse clicks on an object.
onclick onmouseover onfocus
document.getElementById("id").onclick = function(){
  alert("http://CoursesWeb.net/");
}
Indicate the PHP variable that contains the contents of both $_GET, $_POST, and $_COOKIE arrays.
$_SESSION $_GET $_REQUEST
if(isset($_REQUEST["id"])) {
  echo $_REQUEST["id"];
}
htaccess - Redirect URL address from HTTP and WWW to HTTPS

Last accessed pages

  1. Star shapes with CSS (5680)
  2. PHP getElementById and getElementsByTagName (34520)
  3. MSLA2 - Filter Content with Multiple Select Lists with Ajax (1838)
  4. Get the value of the selected /checked checkboxes in a form (42255)
  5. MySQL Query Builder: Insert, Update, Delete (538)

Popular pages this month

  1. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (1919)
  2. Contact page - CoursesWeb (1866)
  3. Tabs effect with CSS (1865)
  4. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (588)
  5. Insert, Select and Update NULL value in MySQL (453)