• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

move link

I have my own web that many page link to it , If I move that page to another directory how can I set the other pages  link to new directory,
0
teera
Asked:
teera
2 Solutions
 
SanctusCommented:
If I understood correctly you want to redirect people from one web page to another, because you moved the page somewhere else.
One way to do this is using a redirect meta tag:

<meta http-equiv="refresh" content="2;url=http://destination/path">

You should put this tag on the header section of the html page
In this case 2 is the number of seconds that the page will be shown before the redirection. This allows you to show the viewers that the content was moved before redirecting them automatically.



0
 
JohnModigCommented:
I would suggest avoiding this META tag whenever possible.
Many browsers nowadays has security settings that does not allow redirection via META.
Also, you cannot put it in your current index file, because it would then refresh itself over and over again.
It is better to use server-side scriptning instead. Then you will be sure your visitors will be redirected.

The 301 status code is used to indicate that a page has permanently moved.
In order to redirect an out-of-print web page to another location, return the HTTP 301 status code and a location header in the HTTP response of the deprecated web page. This is also particularly useful for search engines like Google, which will carry over page rank to the new page if this status code is seen. See code below:
--------------------------------
If you are using ASP:
--------------------------------
<%@ Language=VBScript %>
<%
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.somacon.com/"
Response.End
%>
--------------------------------
If you are using PHP:
--------------------------------
<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.somacon.com/");
exit();
?>
--------------------------------
If you don't have server-side scripting support on your web server, you can still do redirection, but not as elegantly.
My suggestion is to create a new html page using below code, place it in the old directory. Note that some users may have javascript disabled, hence the need to create a link inside the body of the document.
--------------------------------
<html>
<head>
<script type="text/javascript">
window.location.href='http://www.somacon.com/';
</script>
</head>
<body>
This page has moved to <a href="http://somacon.com/">http://somacon.com/</a>
</body>
</html>
--------------------------------
Regards,
John
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now