Maytech Logo

Hot and Cold

Conditioning for your comfort

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.

Example

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:

  1. The rank better in search engines

  2. Search engines will index them faster than dynamic pages.

  3. Historically not all dynamic pages were even indexed due to some being temporary, php or hidden.

  4. They are better looking to end users.

  5. 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:

https://www.maytech.biz/index.html?title=Page_title

Can be rewritten as static links:

https://www.maytech.biz/home

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:

https://www.maytech.biz/blog/posts.php?Year=2021&Month=03&Day=18

As:

https://www.maytech.biz/blog/21/03/18

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.

e.g.

https://www.maytech.biz/blog/21/03

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.

Navigation

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?

e.g.

https://www.officeworks.com.au/shop/officeworks/c/technology/headphones-earphones/true-wireless-earbuds

Seeing Mod ReWrite at Work

You can now see mod rewrite at work when you change the permalinks settings on your WordPress blog.

Wordpress permalinks settings

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