Redirecting a URL via DNS does not need to be challenging, but it can be intimidating for anyone who has never edited a .htaccess file before. DNS stands for domain name service, and .htaccess is a file used to configure servers running Apache Web Server software. Enabling URL redirection in this manner, however, allows for a better user experience by providing readable URLs to visitors, as well as clean transitions if a site moves from one domain to another.
-
Log onto your server. Depending on your setup, this may be through cPanel or other Web-based control panel. You can also use File Transfer Protocol, or FTP, which is an efficient way for transferring files on and off of your server.
-
Open .htaccess for editing. This file should exist on the "root" or main folder of your server. If it does not exist, open Notepad and create a new file called ".htaccess." Use the file manager in cPanel or a Web-based control panel, or FTP the file to the root folder.
-
Type the following line of code in your .htaccess file. Do not duplicate the code if it is already present. Simply modify it to suit your needs.
RedirectPermanent / http://www.NewDomainName.com
Note: If the redirect is not permanent, use this code instead:
Redirect / http://www.NewDomainName.com
Tips & Warnings
- Change www.NewDomainName.com with your new domain.
Related Searches
References
- Photo Credit Ryan McVay/Photodisc/Getty Images
