Search Engine Friendly Redirects
Mon, 01/15/2007 - 01:06 — sandip301 redirect is the most efficient and Search Engine friendly method for webpage redirection. If you have to change file names or move pages around, it's the safest option and preserves your search engine rankings. The code "301" is interpreted as "moved permanently".
With php:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://host.domain.tld" );
?>
With mod_rewrite:
RewriteEngine on
#Redirect Old domain to New domain
RewriteRule (.*) http://host.domain.tld/$1 [R=301,L]
# Redirect a particular domain
RewriteCond %{http_host} ^domain\.tld$ [NC]
RewriteRule ^(.*)$ http://host.newdomain.tld/$1 [R=301,L]
# Redirect a particular file
RewriteRule ^old_file.html$ http://host.domain.tld/new_fil e.html [R=301,L]
- sandip's blog
- Login or register to post comments
- Read more
Block IP addresses from accessing your site via .htaccess
Sun, 01/14/2007 - 00:47 — sandipThere are couple ways to block an IP, the one general way is to use htaccess deny feature.
SetEnvIf REMOTE_ADDR "^xxx.xxx.xxx.xxx$" badip
SetEnvIf REMOTE_ADDR "^xxx.xxx.xxx.xxx$" badip
<Limit GET POST>
order deny,allow
deny from env=badip
</Limit>
- sandip's blog
- Login or register to post comments
Disk ARchive (Backup and Restore) using dar and kdar(dar Frontend)
Fri, 01/12/2007 - 05:34 — david23Dar is a shell command that makes backup of a directory tree and files. Its features include splitting archives over several files, CDs, ZIPs, or floppies, compression, full or differential backups, strong encryption, proper saving and restoration of hard links and extended attributes, remote backup using pipes and external command (such as ssh), and rearrangement of the “slices” of an existing archive. It can now run commands between slices, encrypt archives, and quickly retrieve individual files from differential and full backups.
- david23's blog
- Login or register to post comments
- Read more
Delete Qmail Server messages Queue
Fri, 01/12/2007 - 05:34 — david23qmail is a mail transfer agent that runs on Unix. It was more secure replacement for the popular Sendmail program. The author offered a $500 prize for the first person to publish a verifiable security hole in the latest version of the software.
- david23's blog
- Login or register to post comments
- Read more
Change your Network card MAC ( Media Access Control) address Using macchanger
Thu, 01/04/2007 - 07:42 — david23Media Access Control address, a hardware address that uniquely identifies each node of a network. In IEEE 802 networks, the Data Link Control (DLC) layer of the OSI Reference Model is divided into two sublayers: the Logical Link Control (LLC) layer and the Media Access Control (MAC) layer. The MAC layer interfaces directly with the network medium.Consequently, each different type of network medium requires a different MAC layer. On networks that do not conform to the IEEE 802 standards but do conform to the OSI Reference Model, the node address is called the Data Link Control (DLC) address.
- david23's blog
- Login or register to post comments
- Read more
Blogging From Ubuntu Using Drivel
Thu, 01/04/2007 - 07:41 — david23Drivel is a GNOME client for working with online journals, also known as weblogs or simply blogs. It retains a simple and elegant design while providing many powerful features.
- david23's blog
- Login or register to post comments
Extract individual files from an RPM
Mon, 01/01/2007 - 17:39 — sandipTo extract an individual file from an rpm package without installing the rpm:
-
Use rpm2cpio or rpm -qpl to list files and full paths in the package:
$ rpm2cpio <package_name> | cpio -t
Use rpm2cpio to extract a file. Run this command from /tmp or elsewhere in order to avoid overwriting any current system files.
This creates the full path in the current directory and extracts the file specified.
$ rpm2cpio <package_name> | cpio -iv --make-directories <full-file-path>
To extract everything to the current directory:
$ rpm2cpio <package_name> | cpio -ivd
- sandip's blog
- Login or register to post comments
SSH your Debian servers without password
Fri, 12/29/2006 - 07:21 — david23Secure Shell is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over unsecure channels. It is intended as a replacement for telnet, rlogin, rsh, and rcp. For SSH2, there is a replacement for FTP: sftp.This might be useful if you are trying to connect everytime to your server remotely.
- david23's blog
- Login or register to post comments
Load your PHP pages faster with GZip compression
Sat, 12/23/2006 - 00:57 — sandipIf you have heavy pages with lots of images and text, you can greatly improve its' performance by dynamically compressing the page with php.
Put the below code in the header of each php page.
<? ob_start("ob_gzhandler&qu ot;); ?>
It automatically gzips the page for browsers that support it.
This could also be set in the php.ini file instead, so all php pages are automatically compressed without having to add the above code in each and every php page.
In php.ini add the below code:
output_handler = ob_gzhandler
- sandip's blog
- Login or register to post comments
- Read more
Kubuntu 6.10 (Edgy Eft) Step By Step Installation with Screenshots
Thu, 12/21/2006 - 05:29 — david23Kubuntu is a user friendly operating system based on KDE, the K Desktop Environment. With a predictable 6 month release cycle and part of the Ubuntu project, Kubuntu is the GNU/Linux distribution for everyone.
- david23's blog
- Login or register to post comments