Linux, Web Server & Database

Configure URL Rewrite Rules

Set up custom URL rewrite rules to create clean, specific URLs or redirects your server doesn't handle by default.

The Problem

You need specific URL behaviour your application or CMS doesn't provide out of the box — a custom redirect, a cleaner URL structure, or rewriting old URLs to new ones after a site restructure — and getting rewrite rule syntax right is notoriously fiddly.

About this problem

URL rewriting lets a web server quietly translate what a visitor sees in their address bar into whatever internal path or query string the application actually needs, which is how most frameworks achieve clean URLs, and it's also how old URLs get redirected to new ones after a site restructure without breaking existing links and SEO value.

This typically comes up after a site redesign that changed URL structure, or when a custom integration needs a specific URL pattern the application doesn't natively support.

What's Included

What's NOT Included

How It Works

  1. Map out exactly which URL patterns need to change and what they should become.
  2. Write the rewrite/redirect rules at the appropriate level (Nginx's rewrite/location blocks, or Apache's mod_rewrite/.htaccess).
  3. Order the rules correctly, since rewrite rules are evaluated in sequence and an earlier match can prevent a later, more specific one from firing.
  4. Test each rule against the intended URLs plus a few realistic variations (trailing slashes, query strings, different cases).
  5. Confirm existing working URLs on the site are unaffected by the new rules before calling it done.

In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.

Frequently Asked Questions

What's the difference between a redirect and a rewrite?
A redirect sends the visitor's browser a new URL to request (visible in the address bar), while a rewrite changes what the server does internally without the visitor's address bar changing at all.
Why isn't my rewrite rule working?
Often because an earlier rule in the file already matched and stopped processing, or a small regex mistake in the pattern — rewrite rule order and precision both matter a lot.
Can URL rewriting help with old URLs after a site redesign?
Yes, this is one of the most common uses — redirecting old URL patterns to their new equivalents preserves both visitor bookmarks and the SEO value built up by the old pages.
Do I need rewrite rules for clean URLs in WordPress?
WordPress handles its own permalink rewriting automatically once configured, but custom rewrite needs beyond what WordPress's permalink settings offer still require manual rules.
Is it risky to add custom rewrite rules to a live site?
It can be if untested, since a badly written rule can accidentally redirect or break working pages — thorough testing against both target and existing URLs before finalising is the safeguard.
Where do rewrite rules live — in the web server or the application?
They can live in either, depending on the need — web-server-level rules (Nginx config, .htaccess) handle things before the application even runs, while some frameworks also offer their own routing layer.
Please note: the price shown applies to a standard case matching the description above. Every situation is different, and if your request falls outside the normal scope of this service, I will explain this before doing any additional chargeable work. I will never silently turn a small job into an expensive project.
Running into an issue with a service you've already bought, or unsure which one fits your problem? Message me directly on WhatsApp — no ticket system, no bot.