This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Website Design Forum > March 2006 > Handling a . at end of URL where it shouldn't be





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Handling a . at end of URL where it shouldn't be
Garmt de Vries

2006-03-31, 6:48 pm

When there's a new page on our site that visitors may find interesting, I
send an e-mail to our mailing list. In this message, I give the link of
the new page. Since the URL is just part of a sentence, it may happen that
it is followed immediately by a period:

For more info, see http://www.example.com/newpage.html.

Many mail clients make a link in a plain text e-mail message clickable,
which is a good thing. However, some of these clients treat the period at
the end of the sentence as being part of the URL, with the result that the
visitor is presented a 404 error message.

I have corrected for this behaviour by adding the following to my
..htaccess:

RewriteRule ^(.*)\.$ $1

I could also have decided to avoid a period directly after a URL, but
other people may write about this new page as well. The RewriteRule is a
universal solution.

The drawback of this method is that it messes up the statistics I might
derive from the access logs. Visitors of this page are now divided over
two URLs.

I wonder how other people handle this situation.

--
Garmt de Vries
Beauregard T. Shagnasty

2006-03-31, 6:48 pm

Garmt de Vries wrote:

> When there's a new page on our site that visitors may find interesting, I
> send an e-mail to our mailing list. In this message, I give the link of
> the new page. Since the URL is just part of a sentence, it may happen that
> it is followed immediately by a period:
>
> For more info, see http://www.example.com/newpage.html.


Try it with brackets in your email:

For more info, see <http://www.example.com/newpage.html>.

--
-bts
-Warning: I brake for lawn deer
Gary Peek

2006-03-31, 6:48 pm

Garmt de Vries wrote:
> When there's a new page on our site that visitors may find interesting,
> I send an e-mail to our mailing list. In this message, I give the link
> of the new page. Since the URL is just part of a sentence, it may
> happen that it is followed immediately by a period:
>
> For more info, see http://www.example.com/newpage.html.
>
> Many mail clients make a link in a plain text e-mail message clickable,
> which is a good thing. However, some of these clients treat the period
> at the end of the sentence as being part of the URL, with the result
> that the visitor is presented a 404 error message.
>
> I have corrected for this behaviour by adding the following to my
> .htaccess:
>
> RewriteRule ^(.*)\.$ $1
>
> I could also have decided to avoid a period directly after a URL, but
> other people may write about this new page as well. The RewriteRule is
> a universal solution.
>
> The drawback of this method is that it messes up the statistics I might
> derive from the access logs. Visitors of this page are now divided over
> two URLs.
>
> I wonder how other people handle this situation.
>


I find that writing the sentance differently is the easiest.

Garmt de Vries

2006-03-31, 6:48 pm

On Fri, 31 Mar 2006 14:50:47 +0200, Beauregard T. Shagnasty
<a.nony.mous@example.invalid> wrote:

> Garmt de Vries wrote:
>
>
> Try it with brackets in your email:
>
> For more info, see <http://www.example.com/newpage.html>.


Sounds like a good plan, but how does this look in a mail client that
expects HTML-formatted mail? Wouldn't it treat the
<http://www.example.com/newpage.html> as if it were a tag?

--
Garmt de Vries
Beauregard T. Shagnasty

2006-03-31, 6:48 pm

Garmt de Vries wrote:

> On Fri, 31 Mar 2006 14:50:47 +0200, Beauregard T. Shagnasty
> <a.nony.mous@example.invalid> wrote:
>
>
> Sounds like a good plan, but how does this look in a mail client that
> expects HTML-formatted mail? Wouldn't it treat the
> <http://www.example.com/newpage.html> as if it were a tag?


Don't you want it to be a clickable link?

You can also compose it as:
<URL:http://www.example.com/newpage.html>

All email clients that I am familiar with will treat it as a link.

--
-bts
-Warning: I brake for lawn deer
Andreas Prilop

2006-03-31, 6:48 pm

On Fri, 31 Mar 2006, Garmt de Vries wrote:

> For more info, see http://www.example.com/newpage.html.


Make that

For more info, see http://www.example.com/newpage.html .

always with a space before period, comma, etc.

Stan Brown

2006-03-31, 6:48 pm

Fri, 31 Mar 2006 11:21:49 +0200 from Garmt de Vries
<garmtdevries@googlemail.com>:
> For more info, see http://www.example.com/newpage.html.
>
> Many mail clients make a link in a plain text e-mail message clickable,
> which is a good thing. However, some of these clients treat the period at
> the end of the sentence as being part of the URL, with the result that the
> visitor is presented a 404 error message.


And they're doing the right thing. The period "." is a valid
character in URLs.

The right way to delimit such links is with spaces, like this:
For more info, see http://www.example.com/newpage.html .
or with angle brackets, like this:
For more info, see <http://www.example.com/newpage.html>.
or
For more info, see <URL:http://www.example.com/newpage.html>.

(Stuff about server-based hacks, snipped.)

> I wonder how other people handle this situation.


With respect, I think the right way is to write the URL correctly
yourself, and not try to fuss with it at the server. Don't worry
about what folks do who refer to your pages: Peer pressure is usually
exerted on people who post un-clickable URLs.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/20...e_wont_help_you
Stan Brown

2006-03-31, 6:48 pm

Fri, 31 Mar 2006 16:57:27 +0200 from Garmt de Vries
<garmtdevries@googlemail.com>:
> Sounds like a good plan, but how does this look in a mail client that
> expects HTML-formatted mail?


A mail client would have to be pretty badly broken to treat an
incoming text mail as HTML. There are headers that identify the type
of content; if the HTML-type header isn't there then the mail client
has no business interpreting the message as HTML.

I understand your desire to make things better, but IMHO these ad-hoc
solutions do more harm than good, because they encourage the users of
broken mailers to believe that the problem is on the other end.
"Don't tell me my mailer is wrong! Garmt's mails always come through
just fine."

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/20...e_wont_help_you
David Dorward

2006-03-31, 6:48 pm

Garmt de Vries wrote:

> RewriteRule ^(.*)\.$ $1


> The drawback of this method is that it messes up the statistics I might
> derive from the access logs. Visitors of this page are now divided over
> two URLs.


RedirectMatch permanent ^(.*)\.$ http://www.example.com/$1

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews