Skip to content

This is a basic .htaccess file which uses the rewrite engine of a webserver to redirect from an old Domain to the New domain keeping the original link intact.

Notifications You must be signed in to change notification settings

Hailey-Ross/RewriteURL-to-NewDomain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Redirect Old Links to New Domain

This is a basic .htaccess file which uses the rewrite engine of a webserver to redirect from an old Domain to the New domain keeping the original link intact.

This is used by MoBogaming.com to redirect all old links/files to the new domain Hails.cc

Code

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain.tld$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.tld$
RewriteRule ^(.*)$ http://new-domain.tld/$1 [R=301,L]

Usage

  • Copy the code from above
  • Create a file named .htaccess on your web server and paste the code
  • Edit the Domains and TLD to match your use case
  • Enjoy~

Requirements

This requires ENABLING the Rewrite Engine for your web server.

About

This is a basic .htaccess file which uses the rewrite engine of a webserver to redirect from an old Domain to the New domain keeping the original link intact.

Topics

Resources

Stars

Watchers

Forks