473,606 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to make a link to an old page go to a new page without displaying anything

ted
I have an old link that was widely distributed. I would now like to
put a link on that old
page that will go to a new page without displaying anything.

Aug 20 '07 #1
38 5056
On Mon, 20 Aug 2007 09:08:51 +0200, <te*@shapin.org wrote:
I have an old link that was widely distributed. I would now like to
put a link on that old
page that will go to a new page without displaying anything.
Assuming your "old" link is deprecated and shouldn't be used anymore (i.e.
people ought to update their bookmarks and their links to the new target),
you should use a 301 Moved Permanently HTTP redirect.

See:
http://www.ietf.org/rfc/rfc2616.txt
http://www.w3.org/DesignIssues/UserAgent.html

Please, do not use the http-equiv=refresh meta, it "breaks the back
button".
http://www.w3.org/QA/Tips/reback

If your content management system is good, you should be able to setup a
301 redirection.
http://www.w3.org/TR/chips/#gl2

If you use an Apache server:
http://www.mcanerin.com/EN/articles/...ect-apache.asp

Simply add a "Redirect 301 /old/old.html http://domain/new/new.html" line
in a .htaccess file.

If you use an ASP server, PHP, a CGI script or ColdFusion, it should be
easy too:
http://www.somacon.com/p145.php
A few others at:
http://www.webconfs.com/how-to-redirect-a-webpage.php

If you still don't find your management system there, then, use google:
http://www.google.com/search?hl=en&l...P+301+redirect

If google doesn't help, contact the authority responsible of your content
mangement system.

Note: Choose a good scheme for your URI, so that they're not likely to
change:
http://www.w3.org/Provider/Style/URI

I hope it helps.
--
You can contact me at <ta********@yah oo.fr>
Aug 20 '07 #2
On 8/20/2007 12:08 AM, te*@shapin.org wrote:
I have an old link that was widely distributed. I would now like to
put a link on that old
page that will go to a new page without displaying anything.
Actually you should display a warning page. That way, visitors who have
set bookmarks (in IE, "favorites" ) or who have links in their own Web
pages can update them.

I generally replace the old page with a warning page for about 3 months.
The warning page tells the user that the URI has changed and gives the
new URI as a link. In case the user has dozed off or gone to get a
snack, I do not use REFRESH to reach the new page from the warning page.

As an alternative, you can set a "soft-link" on your Web server. This
causes any reference to the old file-path to become a reference to the
new file path. For this, you must have a shell account on your sever so
that you can establish a Telnet or similar session.

In the directory that used to hold the old file, execute the command:
ln -s newfilepath oldfile
where "newfilepat h" is the name and location of the new file relative to
the old file's directory and "oldfile" is the complete name (with
extension) of the old file. Thus, if I had an old page
<http://www.rossde.com/foo/work.htmland replaced it with
<http://www.rossde.com/bar/fun.html>, the command would be executed in
the /foo directory and would be
ln -s ../bar/fun.html work.html
Note that I use this only for temporary changes in URIs because I want
users to be able to update their bookmarks. I also use it where I
changed a graphic file and don't want to update all the HTML files that
reference it (e.g., replacing a PNG file with a GIF file).
--
David E. Ross
<http://www.rossde.com/>

Natural foods can be harmful: Look at all the
people who die of natural causes.
Aug 20 '07 #3
Scripsit David E. Ross:
On 8/20/2007 12:08 AM, te*@shapin.org wrote:
>I have an old link that was widely distributed. I would now like to
put a link on that old
page that will go to a new page without displaying anything.

Actually you should display a warning page.
Hardly. Sounds like splash page. And it is.
That way, visitors who
have set bookmarks (in IE, "favorites" ) or who have links in their
own Web pages can update them.
How many people care about such things? Most people just want to see the
content.

If you care about such issues, you should include a note in the actual page
content, in its new address. Something like "This page now (since [insert
data]) resides at a new address. You may wish to consider updating it in
your bookmarks (favorites)." But even that is a bit naive.
I generally replace the old page with a warning page for about 3
months.
If you do that, search engines will see that the page content has radically
changed and is now minimal. What will they do? Well, they _may_ check the
link and consider indexing the linked page, as a new page. Or maybe as a new
address for an old page if they do some heuristics, but will they?

Instead, if you use HTTP redirect, as already described in a very good reply
here, search engines will notify that the address has changed and act
accordingly.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 20 '07 #4
On 20 Aug, 16:34, "David E. Ross" <nob...@nowhere .notwrote:
Actually you should display a warning page.
Not for a 301. It's gone, just deal with it.

For a 302 there's some justification to temporary notice of roadworks.

Aug 20 '07 #5

On Mon, 20 Aug 2007 17:34:10 +0200, David E. Ross <no****@nowhere .not>
wrote:
I also use it where I
changed a graphic file and don't want to update all the HTML files that
reference it (e.g., replacing a PNG file with a GIF file).
Advice (not to be taken as offensive, but only as advice): Don't put file
extensions in URI. They're likely to change, and are usually irrelevant at
describing the resource identified by the URI.

HTTP provides a powerful content negotiation. The same resource,
identified by the same URI, can be represented in the best format
supported by the user agent. The same URI can be used either for a gif,
for a png, or for *both*.

One may think that this could be a problem with user agents that don't
have a good support for HTTP. Actually, content negotiation of gif/png
images for URI without file extension works with Netscape Navigator 1. No
problem on that side.

Other guidelines for designing good URI are available in the Tim
Berners-Lee article I previously cited:
http://www.w3.org/Provider/Style/URI

--
You can contact me at <ta********@yah oo.fr>
Aug 20 '07 #6
Stefan Ram wrote:
"André Gillibert" <ta*******@yaho o.frwrites:
>Don't put file extensions in URI. They're likely to change,

An URI cannot contain a file extension. In

http://example.com/example.htm

, the ».htm« is not a file extension,
just a part of the final path segment.

When the resource type was HTML and then becomes PDF,
there is no reason for this URI to change.
You mean, if we ignore the fact that the server will generally be
looking for a file called example.htm that no longer exists and won't
know to send, instead, the new file generated with Acrobat Distiller
that's called example.pdf?
Aug 20 '07 #7
On 8/20/2007 10:54 AM, André Gillibert wrote [in part]:
On Mon, 20 Aug 2007 17:34:10 +0200, David E. Ross <no****@nowhere .not>
wrote:
>I also use it where I
changed a graphic file and don't want to update all the HTML files that
reference it (e.g., replacing a PNG file with a GIF file).

Advice (not to be taken as offensive, but only as advice): Don't put file
extensions in URI. They're likely to change, and are usually irrelevant at
describing the resource identified by the URI.
I include the extensions so that I can do preliminary testing of pages
and their links to other pages in the site from my PC before I upload
the files. In this case, I'm not using a server; I'm using WindowsXP to
supply the referenced files. I have my complete Web site (actually, two
different sites) completely structured on my PC exactly as it is
structured on the server. The only difference is that my home page is
at <file:///D:/Web/myWeb/VCnet/index.htmlon my PC instead of
<http://www.rossde.com/(or <file:///D:/Web/CFOPWeb/index.htmlinste ad
of <http://www.oakparkfoun dation.org/>).

Of course, I could remove the extensions after my local testing.
However, experience has taught me that such modifications then require
addtional testing.

--
David E. Ross
<http://www.rossde.com/>

Natural foods can be harmful: Look at all the
people who die of natural causes.
Aug 20 '07 #8
On Mon, 20 Aug 2007 23:24:00 +0200, Stefan Ram <ra*@zedat.fu-berlin.de>
wrote:
ra*@zedat.fu-berlin.de (Stefan Ram) writes:
>I admit that I also feel fooled when I activate a download
link ending in ».zip« and are being led to an HTML resource
(I believe I saw this at sourceforge).

One could even »download to ...« the resource and then believe
having securily stored the ZIP resource. Possibly learning
only much later, that not a ZIP but an HTML resource was stored.
The web browser I use (Opera), on systems where file extensions are used
to identify file formats (such as Microsoft Windows systems), ignore the
last part of the URI (following the .), and compute the file extension
from the MIME type.

I guess that on systems where other means (e.g. file headers) are used to
identify the format or files, it would entirely remove the .zip, and
wouldn't append any file extension.

One could argue that this behavior is bogous, as there's no reason to
remove the last few characters of an opaque URI (in that case on Windows
systems, the local file name should be something.zip.h tml). On the other
hand, since these last few characters ought to be omitted in the first
place, it "fixes" bogous URI, most of the time.

Anyway, most user agents have a different behavior.

--
You can contact me at <ta********@yah oo.fr>
Aug 20 '07 #9
On 8/20/2007 11:58 AM, David E. Ross wrote:
On 8/20/2007 10:54 AM, André Gillibert wrote [in part]:
>On Mon, 20 Aug 2007 17:34:10 +0200, David E. Ross <no****@nowhere .not>
wrote:
>>I also use it where I
changed a graphic file and don't want to update all the HTML files that
reference it (e.g., replacing a PNG file with a GIF file).
Advice (not to be taken as offensive, but only as advice): Don't put file
extensions in URI. They're likely to change, and are usually irrelevant at
describing the resource identified by the URI.

I include the extensions so that I can do preliminary testing of pages
and their links to other pages in the site from my PC before I upload
the files. In this case, I'm not using a server; I'm using WindowsXP to
supply the referenced files. I have my complete Web site (actually, two
different sites) completely structured on my PC exactly as it is
structured on the server. The only difference is that my home page is
at <file:///D:/Web/myWeb/VCnet/index.htmlon my PC instead of
<http://www.rossde.com/(or <file:///D:/Web/CFOPWeb/index.htmlinste ad
of <http://www.oakparkfoun dation.org/>).

Of course, I could remove the extensions after my local testing.
However, experience has taught me that such modifications then require
addtional testing.
I almost forgot additional reasons to include extensions.

Extensions are not meaningless to me when I maintain my Web site even if
they might not mean anything to my Web server. I give my files mnemonic
names. For example, I have euro.html, which discusses the symbol for
the euro currency; and I have euro.gif, which displays that symbol.
Since I cannot have two files in the same directory with the same name,
the extensions make the names different. In any case, even when I do
not have such potentially conflicting names, I can tell immediately when
I view a directory which files contain HTML and which files contain
images (and what kinds of images: icon, GIF, or JPEG). This helps me to
determine which editor to use on a file.

Another use of extensions is in the index I display at
<http://www.rossde.com/get_index.html> . This uses an SSI script that
involves the UNIX command
ls -ld <directorynam e>/*.html
for each directory in my site. Thus, instead of displaying over 900
files, the script displays the approximately 350 files that contain
HTML. (Yes, I know I could use
ls -ld <directorynam e>/* | grep .html
but that would still require the use of the .html extension on my HTML
files. Other methods that would actually examine the contents of the
files to determine which contain HTML would be too complicated and would
execute too slowly.)

In any case, the average user merely notices underlined, colored text
and recognizes it as a link. Users rarely examine the actual URI.
Thus, I don't understand why it is such a big deal whether I name an
HTML file euro.html, euro_html, or eurohtml. To the Web server, these
are all merely file names.

(I do examine the actual URI -- displayed when my cursor is over the
link -- but only when I'm about to do tabbed browsing. I do that to
ensure the link is not JavaScript, for which SeaMonkey will not open a
new tab unless the script attempts to force a new window.)

--
David E. Ross
<http://www.rossde.com/>

Natural foods can be harmful: Look at all the
people who die of natural causes.
Aug 21 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2471
by: Papa Legba | last post by:
I have huge page of links, to whcih I am currently adding. I would like to add a "random link" button which would parse the current page, extract all URLs then load a random link. Before I start to code, does such s thing already exist. Thanks in advance...
3
1851
by: vishal | last post by:
i am creating a news site. i am adding new news in database and it must be visible to user at top. and then second latest news and so on. i am displaying 15 news on each page and then put a link for next 15 news on page. my site is accessed by millions of people everyday. so for each when he want to see news he click on news link and in my php program query is run in database. so my database access became very slow because if one...
0
1669
by: Moshe | last post by:
Page with a <form> action calls ASP page. The ASP page has the following structure <%@ LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit %> <% Server.ScriptTimeOut=100 With Response .Buffer = True .Expires = 0 .Clear
2
1847
by: Graham J | last post by:
Hello, Apologies for the somewhat wordy and garbled subject as I couldn't think how to phrase it and this has hindered my searching for any previous answers. It could be a really simple question. Anyway... I have a simple javascript function that opens up a new window and writes HTML code in it to display an image (I don't just display the image because of problems with different margins in different browsers). Nothing exotic there. ...
5
4301
by: lawrence | last post by:
Here is a script that is suppose to turn the DIV tag "optionalDiv" visible on click. This works fine on a PC (IE and Netscape both I think) but not on a Mac. Why? <script language="javascript"> document.getElementById('optionalDiv').style.visibility='hidden';
6
4858
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
12
8102
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell me how to do this? I thought perhaps there would be some kind of special meta tag that says something like "exclude me from browser's history", but have been
1
47434
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
1
2476
by: joshai | last post by:
Hi, I'm pretty new to the php/mysql world and am building an article database for a website with multiple content types. I have an entry screen built that allows the site owner to enter articles, set article types, and set articles as features. Each page in the site calls the database for a feature article for that pages content type, then calls again for the 5 newest articles of that content type excluding any article that is identified as a...
0
8430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8078
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8298
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6752
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5892
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5452
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3962
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1548
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.