News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

CodeSnipers.com:
Building Clean URLs Into a Site
June 27, 2006 @ 15:00:14

On CodeSnipers.com today, Peter Harkins talks about a method, using regular expressions and Apache to turn ugly, GET-laden URLs in your application into clean, search engine friendly URLs without altering the underlying scripts.

So we have two goals. First, requests for the new URL are internally rewritten to call the existing scripts without users ever knowing they exist. Second, requests for the old URLs get a 301 redirect to the new URLs so that search engines and good bookmarks immediately switch to the new URLs.

He starts with a sample .htaccess file, showing a simple RewriteRule to take in the request and remap them back to the old PHP script's input format. They work through a few more changes, noting issues along the way (in case you hit them too) and end up with a simple, and much easier way to achieve clean URL bliss.

0 comments voice your opinion now!
clean url mod_rewrite rewriterule search engine clean url mod_rewrite rewriterule search engine


blog comments powered by Disqus

Similar Posts

DevShed: Fetching Search Results as Serialized Arrays with Yahoo Web Services and PHP 5

php|architect: September 2006 Issue Released

Padraic Brady's Blog: ZF Blog Tutorial Addendum #1: Base URL, Magic Quotes, Database Schema & UTF-8

Linux.com: PhpDig excels at small Web site indexing

Zend Developer Zone: Zend Launches Online Documentation Center


Community Events





Don't see your event here?
Let us know!


laravel language series opinion security composer podcast voicesoftheelephpant list interview tool library symfony framework version community release conference artisanfiles introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework