Publish and files

How to write an Apache redirect rule

Create an Apache redirect rule for the intended source, destination and status with PageUtil htaccess Redirect Generator. Review the rule in the context of the existing configuration and test the actual response. A generated snippet alone cannot establish routing behavior on your server.

An htaccess snippet is one 301 or 302 rule. After deploy, the hop list should end on the URL you meant.
An htaccess snippet is one 301 or 302 rule, and it does not read the existing file.

What to run

Open htaccess Redirect Generator. It stays in the browser.

How to read the result

The snippet is one rule, 301 or 302, from a path to a URL.

It does not read your existing .htaccess.

A 301 can be cached by browsers. Review the rule order and existing CDN or application redirects before deploying, so the new rule does not conflict with an HTTPS or hostname rule.

Use the intended replacement URL rather than adding an unnecessary intermediate step. Check meaningful query parameters and the behavior of nearby paths in the actual server configuration.

What to open next

Open Redirect Checker after deploy. The check runs from Cloudflare.

Open HTTP Status Codes if you are unsure which code you emitted. It stays in the browser.

References

Related tools

Frequently asked questions

Does the htaccess generator read my existing file?

No. It does not read your existing .htaccess. An htaccess snippet is one 301 or 302 rule.

Can browsers cache a 301 from the snippet?

Yes. A 301 can be cached by browsers. The snippet is one rule, 301 or 302, from a path to a URL.

How do I check the redirect after it is deployed?

Open Redirect Checker after deploy. The check runs from Cloudflare.

Need help with a tool or found a bug?

Report an issue directly to engineering. No accounts required — all client data remains private on your device.

Report an Issue →