nsindocs Search the docs⌘K
  1. Docs
  2. Rules

URL Rewrites

Change the address nsin asks your server for, without changing the address your visitor sees.

On this page

A rewrite changes the address nsin sends to your server. The visitor's address bar keeps showing what they typed.

Visitor's address bar Extra round trip
Redirect Changes Yes
Rewrite Stays the same No

When to use a rewrite

  • Your site moved, but old public addresses should keep working.
  • A clean public address (/blog/hello) should map to a messier internal one (/index.php?p=hello).
  • One section runs on a different app and its paths should line up.

Create a rewrite

  1. Go to Rules → Add Rule → URL Rewrite.
  2. Set the path match.
  3. Set the path sent to your server.
  4. Choose the query string behavior.
  5. Click Save.

Field reference

Field Options
Path match Wildcard (/old/*) or regex (capture groups reusable in the target path)
Query string Keep, Replace (send a fixed string), Remove
Exclude Carve paths back out of a broader match

Example

  • Applies to: /downloads/*
  • Send to your server as: /files/*
  • Query string: keep

A request for /downloads/report.pdf fetches /files/report.pdf, but the address bar still shows /downloads/report.pdf.

Common questions

Rewrite or redirect? Rewrite to keep old links working invisibly. Redirect to send people and search engines to the new address.

My rewrite does nothing. Check the record is proxied — see Managing DNS Records.

Two rules match the same address. The higher one wins — see Rules Overview.

esc