Enable URL Rewriting in PHP
To enable URL Rewriting in PHP, you have to edit the httpd.conf file of Apache Server.
Step 1: Open "httpd.conf" file in Notepad
Step 2: search the Line have texts LoadModule rewrite_module modules/mod_rewrite.so
Step 3: Un-comment the line by removing # symbol before the line.
Step 4: Restart the server
Example 1 of .htaccess
RewriteEngine On
RewriteBase /project.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).php$ actual_page.php?url=$1
Redirecting non-www to www with .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]