How to Forward URLs

There are many reasons why you might want to forward URLs and a few basic ways to approach it. For a website that has many visits and good search results but has to change its domain name, forwarding is the appropriate choice in this transition process. Visits to the old domain will automatically forward to the new domain. Over time, as search engines update their databases, new domains will be displayed in search results. You perform URL forwarding when you need to redirect several other URLs to a web address, or you want to shorten a complex URL. The URL forwarding method depends on your website's programming code and your experience and confidence in editing that code.

Write the .htaccess 301 Forward code

Picture 1 of How to Forward URLs

Find a website running on an Apache server. This is necessary to continue the .htaccess method - check the web provider if you are unsure.

Picture 2 of How to Forward URLs

Locate and download the .htaccess file. The .htaccess file is what the web provider checks for information for error handling, security, and page request forwarding. Check the root directory (where all website files are stored) and download the files to edit.

Picture 3 of How to Forward URLs

Create .htaccess file. If you don't see .htaccess in the root directory, you can create the file using Notepad (or a similar text editing application). File code in the next step.

Make sure you save the .htaccess file name starting with a '.'

Note the file does not have an extension (e.g. '.com' or '.txt')

Picture 4 of How to Forward URLs

Insert code. Paste the code below into the .htaccess file: .redirect 301 /old/oldURL.com http://www.newURL.com

In the code, "oldURL.com" is the website from which the visitor is forwarded, while "http://www.newURL.com" is the website the visitor is forwarded to .

There must be a space between "oldURL.com" and "http://"

Don't add "http://www" to the (old) URL in the first part of the code!

The "301" code is commonly used on page transitions and "permanent transitions". Research the code "300" further for other functions.

Picture 5 of How to Forward URLs

Set a new destination URL. Change 'http://www.newURL.com' to the domain address you want visitors to be forwarded to.

Picture 6 of How to Forward URLs

Save the .htaccess file. In the 'all files' section, choose to save the .htaccess file without the extension.

Picture 7 of How to Forward URLs

Create backup. Rename the .htaccess and html files with the same name to keep a backup. For example, use the name .htaccessbackup so you can find and recognize the file in case you need to restore previous code.

Picture 8 of How to Forward URLs

Upload the modified file to the root directory of the old domain. You can now modify the code as needed, placing the file in the old URL to read and forward as intended.

Picture 9 of How to Forward URLs

Check the transition process. Open a private browsing window and type the old domain name into the address bar. Once you've completed everything correctly, the website will forward to the new page.

Use a private browsing window to ensure that your browser accesses new transitions instead of relying on cached data (data stored to access good websites faster).

In a private browsing window, you can clear your browser's cache through the customization menu. For more detailed information, read the article Clear Browser Cache.

Use of Relay Services

Picture 10 of How to Forward URLs

Check with the web provider. If you're not sure about your coding abilities or want to forward URLs without touching the code, you can use relay services, and your web provider may be one of them. Many web providers have transition services and companion support to help you achieve your goals. Check this functionality with your current web provider or contact them directly for options.

Picture 11 of How to Forward URLs

Choose an intermediary service. If your web provider doesn't have a relay service, you can choose an intermediary service. Depending on the type of forwarding you need, you may be able to find a free service.

Many services allow you to configure forwarding options, for example the type of forwarding (permanent or temporary) or whether query parameters are passed along.

Only a few services allow you to forward HTTPS (secure) links.

Picture 12 of How to Forward URLs

Follow the direction of the forwarding service. Typically, these services are user-friendly and have step-by-step instructions that make it easy for you to follow.

Note: in some cases, you still need to edit the DNS (Domain Name System) records of the domain you want to forward. You can access it from the supplier's website.

Picture 13 of How to Forward URLs

Update DNS records. The intermediate relay service will notify you if you need to access and edit these records through the server account.

Instructions for editing DNS records in this step completely depend on the service you use, usually both service providers and web providers have simple instructions.

Use Meta Commands

Picture 14 of How to Forward URLs

Access the code snippet of the page you want to forward. This is another method that directly changes the code of the page, you need to download the file linked to the URL thereby redirecting to another page.

Note: in most cases, using Meta directives for forwarding is not ideal. Websites with Meta transition codes are often screened by search engines because it is an unknown technique.

Picture 15 of How to Forward URLs

Open the code for editing. Use 'Notepad' or similar text editing software to open the page's code file. Save a copy before editing as a precaution.

Edit the code. The Meta code begins after the "head" tag () in the page's code snippet. Import : .

There is a space between "refresh" and "content"

"0" is the number of seconds before the transition.

"www.newsite.com/newurl.html" is the address the page forwards to .

It is possible to create a custom error message or notify that your site has moved, but this will attract unwanted attention to the transition page!

Picture 16 of How to Forward URLs

Save the file and re-upload it to the old site. If you're forwarding visits from the old URL, it's likely that other changes have also been replaced in the URL snippet (e.g. removing page content). It is important that the current URL code contains the meta transition code.

Picture 17 of How to Forward URLs

Check forwarding. Enter the URL in your browser's address bar or use a search engine to find it. The website will immediately switch to the new URL written in the code without receiving any notifications or interruptions.

Use Other Programming Languages

Picture 18 of How to Forward URLs

Find your website's programming code. For each programming language, the transition code is a little different. If you're not sure about the answer to this question, contact your web provider for more information.

Picture 19 of How to Forward URLs

Research other forwarding codes. There are different encoding commands for each language and many options to explore within each language. Search the internet to determine the appropriate code for your website.

For example, you can easily learn about PHP, ASP, ColdFusion, and Javascript forwarding code online.

Picture 20 of How to Forward URLs

Check forwarding. Once you've found the right code for your page, the process is similar to other coding methods. Then don't forget to test the forwarding by visiting the (old) URL to see if everything works as planned.

Update 24 October 2023
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile