What is url rewriting in php?

  • Home What is url rewriting in php?
What is url rewriting in php?

What is url rewriting in php?

July 5, 2009

Question:
What is url rewriting in php?

Answer:
URL rewriting is a technique that allows you to use a URL that actually goes to another URL within the same website. This is used mostly in dynamic database generated websites so the final URL is more Search Engine friendly.

Example:
You have an online store selling widgets. The page for the red widgets is: www.yourwidgetstore.com/products.php?productID=50

Using URL rewrites you could change this to:

www.yourwidgetstore.com/red-widgets.html

Both of those links would go to the same place but the second one would have much more value to the search engines.

To do this you need to be using the .htaccess file.

Example:
RewriteEngine On

RewriteRule red-widgets\.html www.yourwidgetstore.com/products.php?productID=50

To avoid any duplicate links within your site, you would then only link to:

www.yourwidgetstore.com/red-widgets.html

About the Author
Rich Agnew is an author for The Computer Geek Custom Web Page Design. The Computer Geek is a web design company that prides itself in professional service at a fraction of the cost. The Computer Geek specializes in Custom Web Design, PHP & MySql and Ecommerce.

To Make a Request For Further Information

5K

Happy Clients

12,800+

Cups Of Coffee

5K

Finished Projects

72+

Awards
TESTIMONIALS

What Our Clients
Are Saying About Us

Get a
Free Consultation


LATEST ARTICLES

See Our Latest
Blog Posts

How 5G Will Transform Industries in the Coming Years
December 21, 2024

How 5G Will Transform Ind

The Importance of Brand Storytelling in Marketing
December 20, 2024

The Importance of Brand S

Intuit Mailchimp