• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with URL display in browser

Guest
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

I'm using a search engine friendly URL system, which works along the following lines;

One of the columns in my table is called 'shortheader', which basically takes the article headline, and makes it url friendly. Therefore, 'This is a Test' becomes 'this_is_a_test' as the shortheader. This part works fine, and when displayed on page, it looks fine.

However, clicking on a link, which on mouseover appears like this - http://www.mydomain.com/this_is_a_test, when the page is displayed the address bar shows as http://www.mydomain.com/this%5Fis%5Fa%5Ftest - which obviously doesn't look too good.

I'm not sure if this makes a difference or not, but the linking page is being created and 'published' using cffile to create a static html page. I have another page, a cfml page, that doesn't seem to have the same effect and works as planned. Therefore, I assume the problem lies with the way cffile is creating the page. That said, looking at the raw HTML of the page cffile creates, it looks fine.

Any help much appreciated!
TOPICS
Advanced techniques

Views

453

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

ColdFusion is not doing this, the browser is.

Spaces and most other non-alpha-numeric characters are not allowed in an
URL according to the HTTP standards. Thus these characters are being
escaped into hexadecimal representing the ASCII code for the characters
by the browser when the URL it process the link after it is clicked on.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied


I have noticed this as well.

For me it's not an issue and I have never paid any attention to it before but it
seems to me that this started after we upgraded to Windows 2003.

Also, it appears to occur intermittently.

Anyway, the first time I noticed it was shortly after our OS upgrade.

I can't see how CF or any thing server side could be causing this and it's
probably the browser. But I have not made any changes to my workstation.

Oh I forgot on last thing, it appears to only happen when there's a server redirect.
But even then, it only sometimes happens.

Weird.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

I'm not sure it can be entirely the browser though - plenty of sites out there seem to manage these types of URLs successfully.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

Can you show the code and the error that it is throwing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

Ok, I appear to have solved my own problem, but I'll post it here for the benefit of anyone else searching in the future.

The problem/cause appears to be IIS. If there is no trailing slash in the URL, IIS does a redirect and changes the url format accordingly. If you add the trailing slash, it does not need to redirect, and therefore keeps the URL nice and clean.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied


Adding the trailing slash works for me as well.

Great job!

... and thank you.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

LATEST
1.) you can turn off 'Check that file exists' within IIS
>IIS WEB > Properties >Home Directory > Configuration

Choose the file extentsion 'Edit'

2.) You can do the following on your page names:
#replace(this.pageName, " ", "_", "all")#

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation