HighDots Forums  

Handling a . at end of URL where it shouldn't be

Website Design comp.infosystems.www.authoring.site-design


Discuss Handling a . at end of URL where it shouldn't be in the Website Design forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Garmt de Vries
 
Posts: n/a

Default Handling a . at end of URL where it shouldn't be - 03-31-2006 , 04:21 AM






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

Reply With Quote
  #2  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 07:50 AM






Garmt de Vries wrote:

Quote:
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


Reply With Quote
  #3  
Old   
Gary Peek
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 08:21 AM



Garmt de Vries wrote:
Quote:
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.



Reply With Quote
  #4  
Old   
Garmt de Vries
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 09:57 AM



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

Quote:
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>.
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


Reply With Quote
  #5  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 10:05 AM



Garmt de Vries wrote:

Quote:
On Fri, 31 Mar 2006 14:50:47 +0200, Beauregard T. Shagnasty
a.nony.mous (AT) example (DOT) invalid> wrote:

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>.

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


Reply With Quote
  #6  
Old   
Andreas Prilop
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 10:22 AM



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

Quote:
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.



Reply With Quote
  #7  
Old   
Stan Brown
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 01:45 PM



Fri, 31 Mar 2006 11:21:49 +0200 from Garmt de Vries
<garmtdevries (AT) googlemail (DOT) com>:
Quote:
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.)

Quote:
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/2003/05/05/why_we_wont_help_you


Reply With Quote
  #8  
Old   
Stan Brown
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 01:47 PM



Fri, 31 Mar 2006 16:57:27 +0200 from Garmt de Vries
<garmtdevries (AT) googlemail (DOT) com>:
Quote:
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/2003/05/05/why_we_wont_help_you


Reply With Quote
  #9  
Old   
David Dorward
 
Posts: n/a

Default Re: Handling a . at end of URL where it shouldn't be - 03-31-2006 , 03:28 PM



Garmt de Vries wrote:

Quote:
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.