Here is few examples how to create a redirect from using .htaccess file:
This redirect allows to redirect all requests from www.yoursite.com to yoursite.com (why it should be done? Google skip mirrored sites, for example www.yoursite.com and yoursite.com are different sites for Google, so some pages can be indexed only for www.yoursite.com and some only for yoursite.com, as a result your domain loses Google Page Rank, so you should decide which of them will be used).
Redirect from WWW to NON-WWW
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
Redirect from NON-WWW to WWW
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^yoursite\.com
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
Redirect from NON-WWW and WWW to another path
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yoursite.com$
RewriteRule ^(.*)$ http://someurl.com/ [R=301]
There are very simple way to limit access to some your resources.
For example, you are not sure in security of your PC (probably it was or are infected by some virus, and some 3rd person can gain an access to your website). In this case you can create .htaccess file in your /admin/ folder and add following code:
Order Deny,Allow
Deny from all
Allow from XXX.XXX.XXX.XXX
Where XXX.XXX.XXX.XXX you WAN IP. If you don’t know your WAN IP it can be checked on such resources as iptools.com (it will be displayed in the top). But you can have a dynamic IP, what does it mean? It means that your ISP change IP address every few hours, so you can’t know what IP you’ll have in next few hours. In that case I advise you to deny access from all IPs (just add following code to .htaccess):
Order Deny,Allow
Deny from all
OR, you can limit access only to some important files (like database configuration file, where saved your database username and password):
<Files config.inc.php>
order allow,deny
deny from all
</Files>
or to some specific extension files:
<Files "\.(sql|tar|tar.gz|rar|zip)$">
order allow,deny
deny from all
</Files>
Also you can protect some folder by the password:
AuthName "Private zone"
AuthType Basic
AuthUserFile /home/your_username/public_html/.htpasswd
require valid-user
</Files>
or file:
<Files
config.inc.php
>
AuthName "Users zone"
AuthType Basic
AuthUserFile /home/your_username/public_html/.htpasswd
</Files>
Password is encoded in .htpasswd
so you need to generate it, you can find in Google many “htaccess passwords generator” or if you have SSH access you can generate username and password yourself:
htpasswd -c /home/your_username/public_html/.htpasswd admin
Step 1. Find a music sound file that you would like to use. Midi (.mid) is a good sound format to use because these files are generally smaller and load quickly, but you can also use .mp3 or .wav music, but keep in mind that big files will take the music longer to load. Be mindful of those who still have slow Internet access.
P.S. Make sure you have rights to the music file before you use it!
Step 2. Next, upload (save) this music file to your web server either using an FTP program or your web host’s file management control panel.
Step 3. Now open the web page you want the song to load with. You’ll have to insert the following HTML code into your site, but first you’ll need to edit it.
<embed src=”musicfile.mp3″ autostart=”true” loop=”false”>
Note: Music file should be in the same folder with web page, or you have to modify src path.