PHP
Code: PHP
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.newdomain.com" );
?>
|
Team Leader
|
![]() |
| 24Feb2006,19:58 | #1 |
|
Whenever we change the names of any files on webserver its better to make a 301 permanent redirect from the old URL to the new URL and for Linux server you can use the .htaccess to make the permanent redirect. I find a disadvantage of this as it is very much dependent on the OS of the server and if you are changing hosts then there could be a problem of old URL not being redirected and so its better to put the redirection into the code. Here are the code snippets to achive the same.
PHP Code: PHP
|
|
Contributor
|
|
| 24Feb2006,20:02 | #2 |
|
In ASP.NET
Code: ASP
Code: ASP
Last edited by aspguy; 24Feb2006 at 20:04.. |
|
Light Poster
|
|
| 24Feb2006,20:08 | #3 |
|
Code:
response.sendError(response.SC_MOVED_PERMANENTLY, "/newURL.jsp"); Last edited by jspguy; 24Feb2006 at 20:10.. |
|
Go4Expert Founder
|
![]() |
| 24Feb2006,20:13 | #4 |
|
Edited title of asp redirect and jsp redirect post.
|