Friday, September 5, 2008

URL Rewriting Script - URL Rewriting through .Htaccess File

URL Rewriting Script - URL Rewriting through .Htaccess File

Static URLs are known to be better than dynamic URLs for a number of reasons:

  • 1. Static URLs typically rank better in search engines.
  • 2. Search engines are known to index the content of dynamic pages much more slowly than that of static pages.
  • 3. Static URLs look friendlier to end users.

Example of a dynamic URL
http://www.yourdomain.com/profile.php?mode=view&u=7

This tool helps you convert dynamic URLs into static looking HTML URLs.

Examples of the above dynamic URL re-written using this tool:

Result : 1st Option

http://www.yourdomain.com/profile-mode-view-u-7.html
OR

Result : 2nd Option

http://www.yourdomain.com/profile/mode/view/u/7/

Note:
You will need to create a file called ".htaccess" and paste the code generated into it. Once you have created the .htacess file simply copy it into your web directory.
URL rewriting of this type will work ONLY if you are hosted with Apache Server.



Results for: http://www.domain.com/profile.php?mode=view&u=7

Method 1 - Single Page URL
Dynamically Generated URL
http://www.domain.com/profile-mode-[VALUE]-u-[VALUE].html

After converting your dynamic URL
http://www.domain.com/profile-mode-view-u-7.html

Create a .htaccess file with the code below
The .htaccess file needs to be placed in http://www.domain.com/
Options +FollowSymLinks RewriteEngine on RewriteRule profile-mode-(.*)-u-(.*)\.html$ profile.php?mode=$1&u=$2


Method 2 - Directory Type URL
Dynamically Generated URL
http://www.domain.com/profile/mode/[VALUE]/u/[VALUE]/

After converting your dynamic URL
http://www.domain.com/profile/mode/view/u/7/

Create a .htaccess file with the code below
The .htaccess file needs to be placed in http://www.domain.com/
Options +FollowSymLinks RewriteEngine on RewriteRule profile/mode/(.*)/u/(.*)/ profile.php?mode=$1&u=$2



For 1st Option Rewrite Rule

Options +FollowSymLinks
RewriteEngine on
RewriteRule profile-mode-(.*)-u-(.*)\.html$ profile.php?mode=$1&u=$2


For 2st Option Rewrite Rule

Options +FollowSymLinks
RewriteEngine on
RewriteRule profile/mode/(.*)/u/(.*)/ profile.php?mode=$1&u=$2


Using RSS Feeds and Mod_rewrite to add Classified Listings on your Website

http://www.seochat.com/c/a/Link-Trading-Help/Using-RSS-Feeds-and-Modrewrite-to-add-Classified-Listings-on-your-Website/

0 comments:

SEO SEM Services - SEO Company™ SEO SEM Expert and Specialist. Offering online SEO services with SEM internet marketing in India. Get the SEO professional advice of expert and Specialists. Know all SEO tools, tips, software, packages online.

 
SEO Services Company™ © 2008 Blogger Template Blogger Templates