Managing Website Redirects

7 vues Website Management

Understanding Redirects

Website redirects automatically send visitors and search engines from one URL to another. They are essential when you move pages, change domain names, or restructure your website. Proper redirects preserve your search engine rankings and ensure visitors reach the correct content.

Types of Redirects

  • 301 Permanent Redirect - Indicates the page has permanently moved to a new URL. Search engines will update their index to use the new URL. Use this for permanent URL changes.
  • 302 Temporary Redirect - Indicates the page has temporarily moved. Search engines will continue to index the original URL. Use this for short-term changes or testing.

Setting Up Redirects in DirectAdmin

  1. Log in to DirectAdmin.
  2. Navigate to Advanced Features.
  3. Click on Redirect (or Website Redirects).
  4. Select the domain you want to add a redirect to.
  5. Enter the source path (the old URL path).
  6. Enter the destination URL (the new full URL).
  7. Choose the redirect type (301 or 302).
  8. Click Add to save the redirect.

Setting Up Redirects via .htaccess

For more control, add redirect rules directly to your .htaccess file:

Redirect a single page:

Redirect 301 /old-page.html https://www.example.com/new-page.html

Redirect an entire directory:

Redirect 301 /old-directory/ https://www.example.com/new-directory/

Redirect to a new domain:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [NC]
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [L,R=301]

Redirect with pattern matching:

RewriteEngine On
RewriteRule ^blog/(.*)$ /articles/$1 [L,R=301]
Avoid creating redirect loops where page A redirects to page B and page B redirects back to page A. This will cause browsers to display an error and can negatively impact your search engine rankings.
After adding redirects, test them by visiting the old URL in your browser or using an online redirect checker tool to verify the correct redirect type and destination.
Besoin d'aide ?

Vous ne trouvez pas ce que vous cherchez ? Notre équipe de support est prête à vous aider.

Contacter le support
Bonjour ! Comment pouvons-nous vous aider ?
Discuter