How to Make my web site popular with search engines

this tutorial will teach you one way to make your website more popular on search engines using pretty urls

Instructions:

  1. Open Notepad on your Windows machine (or a comparable text editor if you're using a Macintosh). Avoid using MS Word or any type of word processor because these programs add extra formatting characters by default that will cause problems.
  2. Copy and paste the following text into Notepad:

    RewriteEngine on
    RewriteBase /basedir
    RewriteRule ^productid([^.]+).*$ yourscript.php?id=$1 [T=application/x-httpd-php]

  3. Change /basedir to the name of the directory containing your dynamic pages. This will normally be just a "/" unless the pages are in a subdirectory, in which case it would be a "/" followed by the name of the subdirectory.
  4. In the "RewriteRule" line, after the question mark, change "id" to whichever variable you're using to pass your product id in order to display the product detail page. Navigate to the link on your site that displays a product detail page from your database. Study the URL in your browser. Normally you'll only have a question mark followed by the product ID. However, if other parameters exist, you'll need to rewrite those too.
  5. In the "RewriteRule" line, change yourscript.php to the name of your dynamic product detail page. This will be the script name seen in the URL often ending in ASP, PHP, or various other extensions. The script name will normally precede the question mark.
  6. If your site does not use PHP, change "T=application/x-httpd-php" to the MIME type for the language that you use.

    If you have questions, the technical documentation for the mod-rewrite functions can be found at: http://httpd.apache.org/docs/mod/mod_rewrite.html

  7. Save the file to your local computer. Name it htaccess.txt.
  8. Upload the file to your Web site in ASCII mode.
  9. Configure your FTP program to display hidden files. Hidden files are files that start with a dot on UNIX or Linux based operating systems. Most FTP programs have an option to display hidden files either on the preference screen or in the settings for the individual FTP site. Some FTP programs will allow you to add parameters to the list command that will display hidden files. In that case, the parameter that you would need to add to the ls command is "-al" (without the quotes).
  10. Test your FTP program to make sure you can view hidden files. Try renaming a non-essential file on your Web site to a filename that starts with a dot. Make sure that it shows up in the directory listing. Then make sure you can rename it back to its original file name.
  11. Rename htaccess.txt to .htaccess (starts with a dot, and no file extension). This will activate your changes.
CAUTION: If you have done something wrong in the htaccess file, your site may stop working after you rename the file. In that case, rename .htaccess back to htaccess.txt and the site should start working again. That's why it's important that your FTP program is configured to see hidden files.

If you set things properly, at this point your web server will automatically rewrite URLs of the format: http://www.yourWeb site.com/yourscript.php?id=123 to: http://www.yourWeb site.com/productid123.htm

The rewriting takes place behind the scenes, so the URL in the address bar will always display in the new format, without the question mark.

8771 - Sat Feb 02, 2013 22:11:24