SEO Tips : Make SE friendly URLs with htaccess on Apache

You love LAMP or WAMP? Either way you got Apache server and if apache on your webhost has mode rewrite enabled you can make use of HTACCESS to turncate long URLs into Search Engine friendly ones. Let assume that you a web domain, e.g You have URLs like you want to change it to a more friendly one then add .htaccess with following lines of code, in the root directory of your website. Root directory is the main folder where you FTP you web pages like
or /local/user/http/public_html/ etc.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+).html?$ index.php?q=$1 [L

How to write .htacess file?

I know windows notepad cannot let you create a .htaccess file as it requires a file name to store its data. I have two solutions for this.

  1. Via Cpanel
    Log into your cpanel account then click on File Explorer and navigat to public_html folder. here you have to click on create new file link given on to or left panel and name it .htaccess. Then copy above given lines of code in it and save it.
  2. WinSyntax code editor
    Download winsyntax code editor (Freeware). It will allow you to save files as .htaccess on windows PC. Then you can upload it to your website with FTP utility.

Author: Param Lowe

SixthSense India ! Q. What is sixthsense? A. Sixth Sense is evolved or developed sensory power of mind. I am the real living example of SixthSense in humans. Wanna learn how to develop sixth sense? Join Param Lowe's online webcast starting April 2012. The fee of joining is USD 9045.00. send email to

Leave a Reply

Your email address will not be published. Required fields are marked *