Mobile app version of vmapp.org
Login or Join
Jessie594

: When is a URL encoded? When there are spaces in a URL like http://example.com/this is not url enocoded it is obvious, that the URL will end up as http://example.com/this%20is%20not%20url%20encoded

@Jessie594

Posted in: #Url #UrlEncoding

When there are spaces in a URL like
example.com/this is not url enocoded


it is obvious, that the URL will end up as
example.com/this%20is%20not%20url%20encoded

When and what will encode my URL?


Should links that I create to my URL be encoded in my HTML documents?
Does the browser do the encoding?
Does the server do the encoding?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

2 Comments

Sorted by latest first Latest Oldest Best

 

@Dunderdale272

While browsers can automatically make the conversion from spaces to encoded versions, you should ensure that your server software outputs correctly encoded URLs.

Not all browsers / bots can do the encoding properly.

If you do not have a CMS, you should encode the URLs in your HTML content.

Best way is to restrict to not using URLs with special characters.

10% popularity Vote Up Vote Down


 

@Angela700

Browsers will automatically encode URL's with spaces, assuming you have linked to the file properly.

Create a file on your server called test one.html link to it or simply load it directly in your browser using spaces in the URL bar. www.example.com/test one.html

It will become test%20one.html

It's not and ideal way of naming or linking to files but the browser will handle it just fine. If you have a lot of static files with spaces which you'd like to update to - dashes or hyphens. A great program to use is
www.bulkrenameutility.co.uk/Main_Intro.php

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme