[Tex/LaTex] add urls in reference

urls

i want to add urls in my reference

i am using the following code in my .tex file

    \bibitem{bl}Business Logic layer, \url{http://en.wikipedia.org/wiki/Business_logic_layer}, 23 12 2011.

however, i get the following output in my console

    ! Undefined control sequence.
    l.477 \bibitem{bl}Business Logic layer, \url
                                        {http://en.wikipedia.org/wiki/Bu...

    ? 
    ! Missing $ inserted.
    <inserted text> 
            $
    l.477 ...rl{http://en.wikipedia.org/wiki/Business_
                                              logic_layer}, 23 12 2011.
    ? 
    ! Extra }, or forgotten $.
    l.477 ....wikipedia.org/wiki/Business_logic_layer}
                                              , 23 12 2011.
    ? 

    ! LaTeX Error: Command \item invalid in math mode.

whereas my .pdf file entry against this code is this.

    Business Logic layer,

http://en.wikipedia.org/wiki/Businesslogiclayer; 23122011

what is this error about and how can i set this right?

Best Answer

To use the command \url you need to load the url package by adding \usepackage{url} to your preamble.

Many packages (like hyperref) load url automatically.