February 12th, 2008
Real-Person Friendly (RPF) URLs
SEF URLs are ready and working in Exponent 0.97. We all have been waiting to checkmark that box in site configuration and use friendly URLs for our sites.

The wait is over and was worth it. The Exponent Team has gone one step further in their implementation of Search Engine Friendly (SEF) URLs. They have made them what I call Real-Person Friendly (RPF) URLs. Search engines don't like URLs that look like:
http://www.mydomain.com/index.php?section=13
or even worse:
http://localhost/alpha097_0210/index.php?action=view&id=1&module=newsmodule&src=%40random41940a897e943
Do you know any real person that likes them? Sure, we have grown accustomed to getting these long strings in our emails and knowing that we have to cut and paste all the lines in the email to get that one long mysterious address that only a machine can understand. And we hope they do. But, just like the search engines real people don't like these URLs.
We have also been told that if we want our pages to be indexed by search engines to bring traffic to our site, we should get our programmers to change these URLs to something without the ?, &, and other punctuation. It's done in Exponent and, like I said, the Team went one step further. Let me explain.
All SEF URLs are not RPF URLs
A lot of implementations of SEF URLs took the transformation of the URL just one step. A URL like:
http://www.mydomain.com/index.php?section=13
became:
http://www.mydomain.com/index.php/section/13
No more punctuation and the search engines are happy. But, for us humans it's no better, there is no hint about the content we want to see. The Exponent implementation gives us that and more.
Exponent SEF URL = RPF URL
Assuming the URL http://www.mydomain.com/index.php?section=13 is a page in your site that you named News you can now give it the SEF name "news" and the URL in Exponent will now be:
http://www.mydomain.com/news/

Yes! Search engines are happy and so are we, the real people. We can all understand that.
Requirements
To use SEF Urls in Exponent your web server must use Apache and support mod_rewrite and .htaccess files. The Apache website has information on . SEF URLs do not work for IIS servers.
Creating SEF names
Creating SEF names for sections is a simple task and the names are saved in the section definition. Remember, you do need go to to Configure Site and enable the checkbox for SEF URLs for these names to actually work.

You have two choices for creating the SEF name:
- Allow Exponent to create them automatically.
- Create your own.
If you use choice 1, Exponent will automatically create friendly URLs from the name of the page section by transforming the name into all lowercase letters and replacing any spaces with a hyphen. If your section name is "About Us" then the URL friendly name for it is "http://www.mydomain.com/about-us/".
If you use choice 2, you can be more flexible and decide yourself what each section is called. Maybe you'd rather not have hyphens, then you could just give your section an SEF name of "aboutus". It's your choice.
Exponent will also create SEF URLs for actions in the form:
http://www.mydomain.com/module/action/var1/value1.../varN/valueN
No more 404 File Not Found Error
This is the friendliest thing about the Exponent implementation of SEF URL. An incorrectly written URL no longer will show a 404 File Not Found error. Exponent will use the search module capability to show the results of the best match to the URL typed. For example, assume you sent your friend a URL http://www.mydomain.com/events/ Your friend rather than cut and paste just remembered that you sent a URL about an event coming up and types...
http://www.mydomain.com/event
Here is where the implementation for Exponent shines. Exponent will search for "event" and show the results, which will give your friend a chance at simply clicking on the right link.

For more technical details on the Exponent SEF URL implementation .
Related CMS news: