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

Line 15: Line 15:
 
The line to should look similar to this:
 
The line to should look similar to this:
  
::'''Redirect 307 /~mary/&nbsp;&nbsp; <nowiki>http://some-other-webserver.com/~mary/</nowiki>'''
+
::'''Redirect &nbsp;307 &nbsp;/~mary/&nbsp;&nbsp; <nowiki>http://some-other-webserver.com/~mary/</nowiki>'''
  
  

Revision as of 13:01, 6 September 2016

You want to take your personal website on our server

http://www.cs.jhu.edu/~mary

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

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

You can do this by adding a line to the .htaccess file in your public_html directory.

NOTE: There are some important things already in the .htaccess file that make PHP work on our systems. Please do erase that code from the file. Just add the following line.


The 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 the redirection at any time simply by editing the .htaccess file. However...

NOTE 1: If you want to stop the redirection you need to remove your Redirect line from the file. Do not remove other existing lines from the file.

NOTE 2: Please do not delete the .htaccess file. If you do, you'll break PHP.