A renamed page needs more than a new address: visitors following the old link should reach the correct replacement. A 301 response describes a permanent move. This guide uses a fictional move from /old-guide.html to /guides/image-basics/ to show how to generate an Apache rule and check its behavior.
Confirm that the server supports .htaccess
.htaccess is an Apache configuration option. Nginx does not use this file; its redirects need a different server configuration.
Ask your host which server handles the request and whether the required directives are allowed. Apache can ignore .htaccess when overrides are disabled. Its .htaccess tutorial explains these permissions. The simple Redirect directive uses mod_alias; the alternative below requires mod_rewrite.
Write down the intended mapping first
For this example, the new page contains the revised image guide. It is not the homepage or a loosely related category. Record the complete old URL, the final destination and any query parameters that must survive the move.
Choose the final slug before creating the rule; our URL slug guide gives a practical naming checklist. Avoid moving the same page repeatedly while deciding on its address.
Generate the single-page rule
- Open the Htaccess Redirect Generator and select Single page redirect.
- Enter
/old-guide.htmlin Old path. - Enter
/guides/image-basics/in New URL or path. - Choose 301 Moved Permanently (permanent) and click Generate Rules.
The active rule in the output is:
Redirect 301 /old-guide.html /guides/image-basics/
The tool also shows a commented rewrite alternative. It generates text; it does not install a WordPress plugin, edit your server or test a live redirect. Its Copy and download controls save the generated text, not the existing server configuration.
Check the matching scope
The generated Redirect uses path-prefix matching. A request for /old-guide.html/extra can also match and append /extra to the destination. The dot in old-guide.html is ordinary text here, not a regular-expression wildcard. See Apache’s Redirect documentation.
If only the exact old path should match, the tool’s alternative for a document-root .htaccess is:
RewriteEngine On
RewriteRule ^old-guide\.html$ /guides/image-basics/ [R=301,L]
The anchors restrict the match; the escaped dot is literal. The pattern has no leading slash because Apache strips the directory prefix in this context. Use one approach, and review its position among existing rules with your administrator. Apache’s RewriteRule documentation explains this context.
Keep query parameters out of Old path
Enter a path, not /old-guide.html?utm_source=email. Page mode has no query-condition controls. With the destination shown above, Apache normally carries the incoming query string forward. Test that behavior if newsletter attribution matters; query-specific matching or deliberate parameter removal needs a separately reviewed rule. Our UTM link guide explains campaign values.
Stage the change with a recovery copy
Back up the current file and test on an equivalent staging server first. Merge the chosen rule into the configuration; do not replace an existing file with the generator’s output. Preserve application routing and other settings. Confirm the destination works before enabling the redirect.
Check other rules that could send the destination back to the source or through another renamed page. A private browser window can help, but response headers give clearer evidence than a page that appears to load successfully.
Inspect the response and the final page
Replace the fictional domain below with your staging address. These curl commands use GET requests and print response headers while discarding the body:
curl -sS -D - -o /dev/null "https://example.com/old-guide.html"
curl -sS -L --max-redirs 5 -D - -o /dev/null "https://example.com/old-guide.html"
On Windows, use curl.exe and replace /dev/null with NUL. The first command does not follow redirects; check for 301 and the intended Location. The second follows them; expect one redirect, then 200. These are expected results for the example, not a live test transcript. A curl -I check uses HEAD rather than GET. See the curl manual.
- Open the final page and confirm that its actual content is the replacement guide.
- Repeat with the old URL plus campaign parameters.
- Test the destination directly: it should not redirect back.
- Test a neighboring path and an unrelated existing page for unintended matches.
Update links after the redirect passes
Point internal links, the sitemap and the replacement page’s canonical URL to the final address. Google’s site-move guidance recommends directing users to the final destination without a redirect chain.
A permanent redirect is a canonicalization signal for Google, not a promise of rankings or an indexing deadline. Check the live responses again after deployment and monitor the old and new URLs rather than assuming generated code proves the move succeeded.