Thursday, March 26, 2009

.htaccess 301 redirection

.htaccess 301 redirection

RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]


Alternate method is


ServerName www.example.com
ServerAdmin webmaster@example.com
DocumentRoot /home/username/public_html

ServerName example.com
RedirectMatch permanent ^/(.*) http://www.example.com/$1


For more details refer http://www.seobook.com/archives/001714.shtml

Wednesday, March 25, 2009

To increase memory limit using .htaccess

To increase memory limit using .htaccess

Put a .htaccess file with the following code in the particular directory


php_value memory_limit 128M

To get the cpanel username

To get the cpanel username

First login to the server as 'root' then

grep domainname.com /etc/userdomains

Friday, March 20, 2009

To get the file names only using grep

To get the file names only using grep command

grep findword . -ir | cut -d: -f1

To search in the .php files only

find . -name "*.php" | grep findword -ir | cut -d: -f1