URL Rewrites
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
Section titled “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
Section titled “Create a rewrite”- Go to Rules → Add Rule → URL Rewrite.
- Set the path match.
- Set the path sent to your server.
- Choose the query string behavior.
- Click Save.
Field reference
Section titled “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
Section titled “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
Section titled “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.