File & Web Services Navigation

Redirecting your website

There are various different types of 300 level redirects, but the most common is a 301 Redirect (Moved Permanently).

In .htaccess files

Redirect 301 /rel-path-to/old-file.php http://www…/full-path-to/new-file.php

So if you wanted to redirect
http://www.eos.ncsu.edu/pages/web/ideas.php to http://www.eos.ncsu.edu/pages/new-web-ideas.php

I would add the following line to the .htaccess file in the root of my website:
Redirect 301 /pages/web/ideas.php http://www.eos.ncsu.edu/pages/new-web-ideas.php

Using PHP

<?php
//place this code at the top of the PHP page you want to redirect
header("Location: relative-or-full-path-to/new-file.php",TRUE,301);
exit;
?>

 

Need more help?

Contact engr-webmaster@ncsu.edu for engineering web support.

You can also build a web site in your Unity account.

See where file and web lockers (PDF) live in Eos file space.


End of Content. Return to Navigation.



North Carolina State University