URL Rewriting (Part 1)

URL rewriting is a process I’ve been using on a number of websites for a long time.  Modern CMS solutions have various built in functions and plugins to make this simple for anything that you might download and try out of the box.  What is under the hood is much less straight forward.

In older versions of Joomla!, my go-to was a plugin called joomSEF.  If all of the links are formatted correctly, this plugin will convert standard php links into more user-friendly style links.  What is happening under the hood?  Well first when the page loads, all of the links that are formatted in a way that Joomla! understands are read, then matched against the database for all of the user-friendly URLs that have been generated.  If the matches are found, the user-friendly URLs will be displayed on the page.  If the match is not found, then the plugin will generate it then insert the record into the database.


While this process is fine for websites with small to medium number of links, any kind of text matching in the database is a very resource intensive process.  One of my websites eventually had to be moved to a VPS server because of this.  By the time it was deactivated, this website alone had 1,872,945 records to search through in a table reaching upwards of a gigabyte.  I needed to actively prune unused records every so often by looking to see which URLs have been unused.




WordPress Themes