Search

All tools
SEO & servers

.htaccess to nginx Redirect Converter

Convert Apache Redirect, RedirectMatch, and common RewriteRule / RewriteCond lines into nginx rewrite or return directives.

Examples

  • 301 path.
  • Force HTTPS.
  • Strip www.

How it works

Apache and nginx express redirects differently. Redirect and RedirectMatch become rewrite ... permanent|redirect. RewriteRule flags R, L, NC, and QSA are mapped where nginx has an equivalent. RewriteCond is supported for HTTPS and HTTP_HOST. Anything else is listed as skipped so you can finish it by hand.

Related tools

Related reading

Your experience on this site will be improved by allowing cookies Cookie Policy