How to Redirect on Apache Server

This will cover instructions on how to create a Redirect on Apache. The following steps will require ownership or control of the site your TinyURL points to. As these changes may lead to an interruption of service for your website, if you don't have or you are unsure how to proceed, please consult with your IT, hosting provider or Web Development team.

Apache Server

Redirecting pages of site on an Apache server can be done my modifying the '.htaccess' file on your website. The .htaccess file will allow you to control configuration changes and is usually placed in the root folder of your website.

  1. Log on to your website and locate .htaccess file in your the root folder.

  2. Open the .htaccess file with Notepad++.

  3. Edit the file and ensure that the following syntax below is correct:

    To redirect a specific page, add a line to the .htaccess file:

     `RedirectPermanent /old-file.html`
     `Redirect 301 /old-file.html`

    To redirect an entire domain, add a line to the .htaccess file:

     `RedirectPermanent /`

Note : Remember to substitute and validate that you have the correct html file names and domain names on these instructions:

		*  '*old-file*'      : This is the html file for your old page
		*  '*new-file*'      : This is the html file for your new page
		*  '**'  : This is the root web folder of your old domain
		*  '**': This is the root web folder of your new domain
  1. After you insert these commands to your pages, remember to put a blank line at the end of your .htaccess file.

  2. Ensure that you save .htaccess file in UNIX format.

Last updated on 8th January 2021

Please enter a valid email address.

Signup for a TinyURL premium account

Unlock access to full analytics to your TinyURLs, use your own branded domain, and more.

View Details

Create an Account

Create an account to enjoy easy link shortening, customized TinyURLs, and full shortened URL history.

Sign Up