Post Free Classifieds     Dev Vani     Twitter     Watch TV

Content

Sixth Sense {Blog}, Spirituality, Hinduism, Free Downloads, SEO, Web dev, Learning PHP, Indian Cooking, News, Earthquake prediction

SEO Tips : Make SE friendly URLs with htaccess on Apache

Monday 2 November 2009 - Filed under SEO Tips + Webdev Tips

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 http://www.example.com. You have URLs like http://www.example.com/topic/sub-topic.php 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
/home/yourname/http_folder/
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.

2009-11-02  »  Param Lowe

Share your thoughts

Re: SEO Tips : Make SE friendly URLs with htaccess on Apache







Tags you can use (optional):
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>