Thursday, July 10, 2014

Import and Export CSV file into mysql database

SELECT * from  `table name` INTO OUTFILE 'table.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ';' ESCAPED BY '"' LINES TERMINATED BY '\r\n'

find / -type f -name table name.csv

load data  infile 'table.csv' into table table name fields terminated by ',' enclosed by '"' lines terminated by '\n'

Wednesday, July 9, 2014

Redirect to domain without www.

redirection rule in .htaccess as follows

RewriteEngine on

# Redirect to domain without www.
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule .* http://%1%{REQUEST_URI} [R=301,L]

Saturday, July 5, 2014