Forum Moderators: open

Message Too Old, No Replies

Use of ampersands in web addresses

To escape or not to escape within HTML ...?

         

StepOne

1:10 pm on Mar 24, 2004 (gmt 0)

10+ Year Member



I would welcome an opinion on the following.

Some of my web pages have links to external pages whose addresses contain ampersands. When I use Tidy to check and clean up my pages it escapes each of these ampersands to &

When I then use the link checker ‘Xenu Link Sleuth’ the web addresses that contain the escaped ampersands are listed as errors, namely:

error code: 302 (object temporarily moved)

Everything seems to work ok, so should I care?

Many thanks.

txbakers

1:23 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would escape.

grahamstewart

1:29 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The ampersand character marks the start of an html entity. If you use it for anything else, such as in an address, then you must escape it for the html to be considered valid.

Sounds like you need to find a better link checker (or let the authors of Xenu know of the problem).

Mohamed_E

2:52 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I always escape my ampersands, and so far Xenu (1.2 d) has never complained. I am therefore rather suspicious of the observation on which this thread is based.

g1smd

9:21 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Run the code through [validator.w3.org...] and it will advise to change the & to & on every occasion.