Guides / .htaccess 301 Redirects: How to Move Your Content Safely

.htaccess 301 Redirects: How to Move Your Content Safely

Deleting a page without redirecting it is like moving to a new house without leaving a forwarding address. πŸ“¦

When you delete an old page or change a URL structure, anyone clicking an old link (or a bookmark) will hit a dead end: a 404 Error page. Worse, Google will drop that page from the search results, and you'll lose all the SEO authority that page built up.

What is an .htaccess file?

If your website runs on an Apache web server, the .htaccess file is a hidden configuration file that controls how your server behaves. Among many things, it allows you to instantly redirect traffic from one URL to another.

A 301 Redirect specifically tells search engines: "This page has moved permanently. Please pass all of its ranking power (link juice) to this new URL."

Common Redirect Scenarios

Writing rewrite rules from scratch can be tricky. A single misplaced character can take your entire site down with an Internal Server Error. Here are the most common scenarios you need to handle:

πŸ”„ Single Page Redirect: Moving /old-post/ to /new-post/.

🌐 Non-WWW to WWW (or vice versa): Ensuring yoursite.com automatically redirects to www.yoursite.com so Google doesn't see them as two duplicate sites.

πŸ”’ HTTP to HTTPS: Forcing all traffic to use the secure, encrypted version of your site.

Here is an example of a simple 301 redirect for a single page:

Redirect 301 /old-url/ https://www.yoursite.com/new-url/

Why It Matters

If you don't set up 301 redirects when restructuring your site, you will see a massive drop in organic traffic. Always map out your old URLs and redirect them to the most relevant new pages.

Generate safe .htaccess rules instantly! πŸš€

Don't risk breaking your server with manual code. Use our generator to create safe, reliable redirect rules for your Apache server.

Try .htaccess Generator ✨

πŸ”₯ More Free SEO Tools