For simple static URL transfers, `Redirect`/`RedirectPermanent` can be used, and `mod_rewrite` can be used for conditional or regex cases. The correct 301 target should go to the final canonical URL in one step; path, query string, and exceptions should be managed consciously.
301 Moved Permanently
Location: https://new.example.com/path
Redirect chain detected
ERR_TOO_MANY_REDIRECTSFor simple static URL transfers, `Redirect`/`RedirectPermanent` can be used, and `mod_rewrite` can be used for conditional or regex cases. The correct 301 target should go to the final canonical URL in one step; path, query string, and exceptions should be managed consciously.
Do not expect a `.htaccess` result without reserving the Apache, LiteSpeed, Plesk proxy or NGINX-only structure.
Back up the current file with the date; Find the directive and line in the Apache/LiteSpeed error log.
Do not change redirect, rewrite, header and access rules all at the same time.
Measure the status, Location, Content-Type and redirect number with curl and check the cache layers separately.
Do not redirect all old URLs indiscriminately to the home page.
Meaning: The source URL redirects back to itself or to a previous URL.
Possible cause: A broad regex or a bidirectional rule.
Meaning: Path is not being preserved.
Possible cause: Using a fixed target.
Meaning: Apache may preserve the existing query by default.
Possible cause: QSD was not used.
Meaning: The old URL passes through intermediate targets.
Possible cause: HTTP, www, and path rules are separate.
Meaning: The dot or question mark was not escaped.
Possible cause: Incorrect regular expression.
Meaning: The rule is in the wrong context or order.
Possible cause: The WordPress front controller runs first.
Meaning: The temporary redirect is creating cache or SEO signal issues.
Possible cause: The R flag has no code or is a panel setting.
Meaning: Apache decodes path at certain stages.
Possible cause: Turkish characters, spaces in URLs, and regex differences.
No records matching this expression were found.
curl -sIL --max-redirs 15 https://example.com/old-url | grep -iE '^HTTP|^location:'Lists all redirect hops.
curl -sS -o /dev/null -w 'HTTP:%{http_code} Final:%{url_effective} Redirects:%{num_redirects}\n' -L https://example.com/old-urlShows the final destination and the number of redirects.
curl -sIL 'https://example.com/old-url?utm_source=test&id=42' | grep -iE '^HTTP|^location:'Shows how parameters are carried to the target.
grep -nE 'Redirect|RedirectMatch|RewriteRule|RewriteCond' .htaccessShows the redirect rules with their order numbers.
while read -r src dst; do final=$(curl -sS -o /dev/null -w '%{url_effective}|%{http_code}|%{num_redirects}' -L "$src"); echo "$src|$dst|$final"; done < redirects.txtKaynak-hedef listesini toplu test eder.
curl -sL https://new.example.com/new-url | grep -ioE '<link[^>]+rel=["'"']canonical["'"'][^>]*>' | head -n 1Shows the target page's canonical tag.
RewriteRule old-page new-page [R=301,L]Redirect 301 /old-page https://example.com/new-pageRewriteRule ^ https://new.example.com/ [R=301,L]RewriteCond %{HTTP_HOST} ^(?:www\.)?old\.example\.com$ [NC]
RewriteRule ^ https://new.example.com%{REQUEST_URI} [R=301,L]RewriteRule ^eski$ /yeni [R=301,L]RewriteRule ^eski$ /yeni? [R=301,L]RewriteRule product /new-product [R=301,L]RewriteRule ^product/?$ /new-product [R=301,L]For fixed-path redirects, it may be simpler and more readable.
Used for host, query, path, and conditional migrations.
Panel redirects can generate `.htaccess` or vhost config entries.
No. NGINX does not read `.htaccess` files. The rule must be translated to a `server` or `location` configuration.
Usually not; Apache evaluates the `.htaccess` file on each request. However, a reload or restart is required for VirtualHost, module, or AllowOverride changes.
A dated backup of the existing file should be taken, the active document root verified, and the change tested on staging or during low-traffic periods.
In cPanel it is usually inside `public_html`, in Plesk inside `httpdocs`; addon domains and subdomains may have a different document root.
LiteSpeed supports most rules through Apache compatibility; some module and handler behaviors may differ.
Full directive and line record in Apache/LiteSpeed error log. The file should be restored according to the log instead of being deleted randomly.
Domain should not be added directly without verifying domain, document root, proxy, WordPress, and server structure. Examples should be adapted and tested.
We examine redirection, rewrite, CORS, access and 500 errors with logs in cPanel, Plesk, LiteSpeed, WordPress, custom PHP and WISECP structures.