Friendly adresses and webfonts
Friendly adresses
A friendly address is a URL that does not have any file extension (e.g., .html
) at the end. Using friendly addresses enhances SEO. To create them, we need a .htaccess
file. Inside it, we map file names to their friendly addresses using RewriteRule
, as shown below. The text given first (pg
) is the friendly address, and page1.html
is the name of the file the user is to be redirected to when the address is used. Friendly addresses work only on servers (a server can be local, e.g., the Apache server from XAMPP).
### PROTECT FILES ###
<FilesMatch "\.(htaccess|htpasswd|ini|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
RewriteEngine on
RewriteRule pg page1.html
Download the template from here.
Web fonts
A web font is a font that can be used on a website, including special icons that are just appropriately styled text. We can download many of those icons for free from Fontello. After downloading the ones we need (as a .zip
file), we have to copy the font
and css
folders to our website directory and link the fontello.css
file in the <head>
tag of every HTML file where we want to use these icons, like this: <link rel="stylesheet" href="css/fontello.css" type="text/css">
. After that, we open the demo.html
file (from the .zip
file) and check the icon names, which we then can use on our website like this: <i class="icon-IconName"></i>
. Remember that these icons are text, not images, so we do not edit their width
but font-size
, etc.