Programming
We provide developers and engineers the guides and tutorials they...
Search
We provide developers and engineers the guides and tutorials they...
Content is king. It's not just about how you're going to write, b...
Looking for an engaging connection with thousands of other people...
Redirect, RedirectMatch, and common RewriteRule flags have nginx equivalents. RewriteEngine does not. Anything you cannot map should stay on a skipped list, not disappear.
Apache Redirect 301 /old /new is a prefix match. nginx wants a rewrite with a capture for the rest of the path, or a return 301. RewriteRule with [R=301,L] is closer to rewrite ... permanent. RewriteEngine On is not a thing you translate; nginx is already rewriting.
Also Read: SEO and Web
R / R=301 become redirect or permanent. L is last. NC can be a (?i) prefix because nginx rewrite is PCRE. QSA is $is_args$args. HTTPS-off plus a host rewrite is an if ($scheme = http) / if ($host ~* ^www\.(.+)$) pair, not a mystery.
Also Read: SEO: UTM parameters that
The .htaccess to nginx converter maps those directives and lists everything else as skipped: Options, Deny, Header, unknown flags. Skipped is the feature. A silent drop is how you lose a decade of marketing URLs on cutover night.
Also Read: Why Slack and iMessage show the wrong title for your post
When the host moves, robots.txt and the sitemap still need to be valid on the new origin. That is a separate pass with the robots.txt and sitemap validator. Do not put the old Apache ErrorDocument 404 into nginx as a rewrite loop.
Test three URLs by hand after deploy: an exact old path, a prefix match with a tail, and a www-to-apex HTTPS hop. If those three work, the rest of a typical blog .htaccess usually does.