News Feed
Sections




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

Tim Bromhead's Blog:
Super friendly URLs - handling spaces with URL Rewrites and PHP
February 20, 2007 @ 13:35:00

In a new entry today, Tim Bromhead shares his method for creating "super friendly urls" for a site's users using mod_rewrite:

Today we are going to show how to make the URLs with spaces super easy to type for users. bla.st uses dashes in the URLs to represent spaces eg. http//bla.st/web-design/. We chose dashes over underscores because underscores can get lost with underlined links, and we think they look nicer.

He includes the Apache config information for working with the VirtualHost entry and the simple PHP script to handle the requests. It looks in the SERVER superglobal, at the QUERY_STRING to see what the user is requesting and does an append and redirect accordingly. This example is made to take any form of a space in the URL (including underscores and %20), parse it out, and pass the user along correctly to the page they want.

20 comments voice your opinion now!
friendly url space virtualhost apache modrewrite friendly url space virtualhost apache modrewrite


blog comments powered by Disqus

Similar Posts

Stefan Mischook's Blog: Installing PHP and MySQL on the Mac with MAMP

The bla.st Blog: Process your URLs in PHP with Apache mod_rewrite and wildcard DNS

Debianhelp.co.uk: LAMP (Linux Apache Mysql PHP) Configuration in Debian

Bob Majdak: Apache access logging in JSON format

Web Developer Juice: 11 easy steps for installing Apache ActiveMQ and configuring it for PHP applica


Community Events





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


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

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