What is Mod ReWrite
Is a module used to rewrite URL’s, creating more visually appealing URL’s from dynamic links. This makes your URL’s search engine friendly as they are now short and pretty. URL’s also become more relevant to their content when they are rewritten like this. Instead of having a long dynamic link full of symbols the URL will succinctly describe exactly what is on the page.
Having this feature makes your URLs search engine friendly, readable to humans and redirects make your site more secure.
A great example of using this module is your Error 404 page and the rewrite method working through your .htacess file or the permalinks settings for Wordpress.
Static vs Dynamic
Static url are considered better than dynamic links:
The rank better in search engines
Search engines will index them faster than dynamic pages.
Historically not all dynamic pages were even indexed due to some being temporary, php or hidden.
They are better looking to end users.
They better describe what is on the page to the user.
Mod ReWrite for dynamic links
The Mod rewrite module will rewrite long dynamic links such as:
Can be rewritten as static links:
Mod ReWrite for protecting IP
MoD rewrite is also useful for protecting you and your client’s intellectual property this can be achieved by redirecting file routes to copy protected URLs. You can also disable hotlinking by adding the rewrite conditions to your htaccess file. Hotlinking not only robs you of your IP but also bandwidth and site performance.
Mod ReWrite for Dates
It can also be used to rewrite URL with post-dates in them instead of having a long URL with an unclear date in it mod rewrite will make the URL appear to be classified by the year month and day your post was made.
It will rewrite this:
This however can make it confusing if you have more than one post on the same day.
But it does allow visitors navigate up from that point to access all blogs in the month by simply erasing the “day” number from the url.
This method does make it difficult to tell what the date actually if the dates are all low value digits for example: 06/02/09.
Per region it would be difficult to tell which of these numbers is the year, month or day. Although the standard for blog urls is the begin year, month than day.
A great bonus of using static urls is the convenience of being able to navigate up as mentioned before this can not only be applied to blog dates but also any navigation your page uses.
With lower-level navigations such as subcategories it is very useful and frequently used by end users to navigate up to higher level categories. How many times have you not found the specific wireless headset you wanted and erased that link one level up to find something else above that subcategory?
Seeing Mod ReWrite at Work
You can now see mod rewrite at work when you change the permalinks settings on your WordPress blog.
Tools you can use
WebConfs’ URL Rewriting Tool suggests Static URL you can use based on the dynamic URL you provide in the field. The tool will also give you the code to insert in your .htaccess file.
Url Rewriting tool