YaBB - Yet another Bulletin Board

Welcome, Guest. Please Login or Register

  Home English Norsk HelpLoginRegisterSearch  
 
 
Pages: 1 2 3 
Send Topic Print
HTML5 - Hypertext Markup Language (Read 512377 times)
Reply #30 - 06/24/18 at 21:57:37  

Administrator   Offline
YaBB Administrator
Welcome to My Bulletin
Board
Oslo

Gender: male
Posts: 290
*****
.htaccess


Apache .htaccess is a configuration file that adjusts the settings of the web servers. The file gets immediate effect in all the files and subfolders of the specified folder it is loaded to and is useful when you do not have access to the configuration file in the main server. An example of a .htaccess file is to redirect from www to non-www and vice versa, as well as from HTTP to HTTPS:

Code:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
 



The example is from Simone's Blog (Carletti, 2016). The first line starts Apache's runtime rewriting engine. The next two lines are the redirect conditions. The first condition determines whether the request uses a non-HTTPS URL, while the other determines whether the request uses www URL. The fourth line avoids directing the host name directly to the URL. «RewriteRule» is the heart of the redirect, and tells Apache to redirect any request to a new URL. The flag «L» stops processing other rules and redirects immediately. «NE» asks Apache not to escape special characters. «R = 301» uses HTTP status code 301. If you want to redirect non-www to www, you can change the third and the fifth lines:

Code:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
 




Sources
 
 
IP Logged
 
Reply #31 - 12/17/18 at 17:55:19  

Administrator   Offline
YaBB Administrator
Welcome to My Bulletin
Board
Oslo

Gender: male
Posts: 290
*****
Make sure the text stays visible while loading fonts


«Font display» is used in CSS for fonts to be visible during loading, and it accepts five values:

  1. AUTO (default): The browser uses the default download method, which often resembles the block value.
  2. BLOCK: The browser hides the text card until the font has fully downloaded, but keep the placeholder. The text will replace as quickly as it has downloaded. Also known as «flash of invisible text» or FOIT.
  3. SWAP: The browser uses default text until the custom font is downloaded. Known as «flash of unstyled text» or FOUT.
  4. FALLBACK: Works as a compromise between auto and swap values. The browser will hide the text for about 100 ms. If the font is not downloaded, it will use the default text (fallback).
  5. OPTIONAL: As FALLBACK, the browser will hide the text, then transition to a FALLBACK font until the custom font is available to use. This value also allows the browser to determine, if the custom font is to be used at all, which is measured by the user's connection speed. Slower connections are less likely to receive the custom font.
 
 
IP Logged
 
Pages: 1 2 3 
Send Topic Print