Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double slashes in urls in Outlook

Tags:

url

outlook

The url of our search page is build like this:
http://www.example.com/results/name/John/city/Miami/gender/Male This would display every male named John in Miami.

When one of the filters is left empty, the url would be something like this:
http://www.example.com/results/name/John/city//gender/Male
So there are two slashes in the url.

Outlook doesn't seem to like this. When you click on the second url, it removes one of the two slashes. This leaves the url like this:
http://www.example.com/results/name/John/city/gender/Male
Persons names John in the city 'gender'..

What would be the best way to fix this problem?

like image 739
Robin Avatar asked Jan 20 '10 13:01

Robin


People also ask

Why is there a double slash in URL?

URLs with a double slash in the path can be generated by content management systems, plugins or broken HTML, and are often caused by issues with relative linking and/or the base URL. You may require developer help to track down the origin of the issue and resolve it.

What does 2 backslashes mean?

Two backslashes are used as a prefix to a server name (hostname). For example, \\a5\c\expenses is the path to the EXPENSES folder on the C: drive on server A5. See UNC, \\, path and forward slash.

What is the difference between forward slashes and backslashes?

Summary: The Backslash and Forward SlashThe backslash (\) is mostly used in computing and isn't a punctuation mark. The forward slash (/) can be used in place of “or” in less formal writing. It's also used to write dates, fractions, abbreviations, and URLs.

What does two forward slashes mean in code?

Lines beginning with // are comments and are ignored during action execution.


2 Answers

This is a bug in Microsoft Office.

URLs with two consecutive slashes are allowed by RFC 2396, but they're not commonly used. As the RFC says (extract from Appendix A):

abs_path      = "/"  path_segments
path_segments = segment *( "/" segment )
segment       = *pchar *( ";" param )

Note that segment is defined as containing ZERO OR MORE characters. (You might argue that this is a spec bug, and it shouldn't be allowed... but it is)

As you've discovered, Microsoft Office will "fix" URLs containing double slashes. This is apparently a deliberate feature for "cleanliness and consistency". There is no way to override or disable it. Source.

So, as other people have suggested, you're probably going to have to change the way the server formats URLs.

like image 187
user9876 Avatar answered Oct 04 '22 01:10

user9876


Try to replace (one of) the slashes with ASCII code 2F (decimal 47).

like image 20
Peter Schuetze Avatar answered Oct 04 '22 01:10

Peter Schuetze