Monday, 23 July 2012

hide .php extension - htaccess

RewriteEngine On

# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ http://localhost/mujib/$1 [R=301,L]

# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ http://localhost/mujib/$1 [R=301,L]

# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]

Sunday, 15 July 2012

.htaccess changes for php4 version transferred to php5

.htaccess and from phpInfo I see that it's now using php5. Great!

AddHandler application/x-httpd-php5 .php
AddType application/x-httpd-php5 .php

Thursday, 12 July 2012

Linux Command Help & phpmyadmin

sudo apt-get install phpmyadmin  

sudo ln -s /etc/phpmyadmin/apache.conf  /etc/apache2/conf.d/phpmyadmin.conf

sudo service apache2 restart


Find
grep -rl "STRING THAT YOU WANT" *

Also note that this does not search hidden directories. The find examples given previously do. I prefer to use xargs in combination with find and grep since it doesn't suffer any size limitations. These find examples will show you the names of the files that contain the pattern or "STRING THAT YOU WANT"

find / -type f | xargs grep -l pattern

or from the current working directory

cd /somedirectory
find . -type f | xargs grep -l "STRING THAT YOU WANT"

Source base installation of php, mysql and apache in ubuntu/ linux

Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source In the last post, I described the method to install a LAMP ser...