Starting from now, all the plisweb sites have been modified to work with friendly URLS. And by saying all the plisweb sites, we mean those that have been created, and those that will be. Nobody will escape the pretty url format. But let’s see what’s exactly a friendly url, and why have we struggled with implementing it on the plisweb environment.
Friendly urls are also called “pretty urls”, and consist on a web site developing technique that encodes the page urls so users cannot see the original ones. For example, let’s imagine that we have a web site that works with the following URL:
http://www.mysite.com/products.php?product_id=1890
As we may be using some database system, we need to pass parameters to our php page so it can render the desired information. Let’s also imagine that this information is related to some cool product that is stored on our DB system.  The website works as expected and does everything we expect it to do. But we have some “small” problems:
1. Everybody will be able to guess the parameters that our site is using.
This is not normally an annoyance, but sometimes may lead to security problems, especially when we are dealing with sensitive data.
2. Some search engines may ignore urls with dynamic parameters.
We know that Google will read the dynamic urls, but we also know that some other engines skip them to avoid unwanted data. So by using parameters in a url, we’re maybe losing potential visitors.
3. The url may contain lots of parameters
In some cases we may need to send tons of GET values to our script, and we may end with a really ugly, unreadable and endless array of strange characters. This is not a problem for computers, but causes problems with humans. We like it polite…
The solution
So how can we solve these problems while keeping the dynamic nature of our site? The answer is “friendly URLS”. By implementing this technique, we will be taking our site to a higher level. Let’s take a look at how would the previous url example look in a friendly URL format:
http://www.mysite.com/products/1890/usb-driven-rocket-launcher
As we can see, the url is more readable by people and still contains the info we need to generate our db queries (that is, the product id value). We solved the security problems as nobody can guess the real dynamic url, and we are also adding keyword information right in the url, so SEO will be better.
If you want to use a friendly encoding, you must understand your web server rewriting protocol. With Apache you normally write a “.htacess” file or directly modify the apache setup depending on your needs. The conversion is done at web server level and is absolutely transparent to the users. You then need to take some things into account, as using this technique involves writing all the website in a different way. We will not be covering the technical details for friendly urls on this article, but here you have some links that will be extremely useful to learn the required technical abilities:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/
As you can see, friendly URLS are cool and useful, and all the plisweb sites that you create with our software will be using it on everything from page sections to pictures.
Happy pliswebbin’ !
The plisweb team
Comments are closed.