Difference between revisions of "Redirect Your Webpage To Another Website"

Line 14: Line 14:
 
You can do this by adding a line to the '''''.htaccess''''' file in your ''public_html'' directory on your Grad and/or Ugrad accounts, depending which URL above you want to use.  Remember, if you have both a Grad and a Ugrad account, and you want to have the redirect for both, you need to follow the following instructions for both accounts.
 
You can do this by adding a line to the '''''.htaccess''''' file in your ''public_html'' directory on your Grad and/or Ugrad accounts, depending which URL above you want to use.  Remember, if you have both a Grad and a Ugrad account, and you want to have the redirect for both, you need to follow the following instructions for both accounts.
  
<span style="color:#ff0000">'''IMPORTANT!''' There are some ''important files'' already in the .htaccess file that make ''PHP'' work on our systems.  Please don't erase that code from the file.  Just add the following '''Redirect''' line. </span>
+
:<span style="color:#ff0000">'''IMPORTANT!''' There are some ''important files'' already in the .htaccess file that make ''PHP'' work on our systems.  Please don't erase that code from the file.  Just add the following '''Redirect''' line. </span>
  
 
The '''Redirect''' line to should look similar to this:
 
The '''Redirect''' line to should look similar to this:

Revision as of 16:25, 5 December 2017

You want to take your personal website on our server, for example:

Your Grad/Research account's webpage: http://www.cs.jhu.edu/~mary
or
your Ugrad account's web page: http://ugrad.cs.jhu.edu/~mary

and have all requests for that site get redirected to another website, for example:

http://some-other-webserver.com/~mary


You can do this by adding a line to the .htaccess file in your public_html directory on your Grad and/or Ugrad accounts, depending which URL above you want to use. Remember, if you have both a Grad and a Ugrad account, and you want to have the redirect for both, you need to follow the following instructions for both accounts.

IMPORTANT! There are some important files already in the .htaccess file that make PHP work on our systems. Please don't erase that code from the file. Just add the following Redirect line.

The Redirect line to should look similar to this:

Redirect  307  /~mary  http://some-other-webserver.com/~mary

In the example above, anyone surfing to http://www.cs.jhu.edu/~mary will get redirected to http://some-other-webserver.com/~mary


You can change or remove the redirection at any time simply by editing the .htaccess file. However...

NOTES:

  • If you want to stop/remove the redirection you need to remove your Redirect line from the file. Do not remove the other existing lines from the file.
  • Please do not delete the .htaccess file. If you do, you'll break PHP.