Home ColdFusion CFLOCATION doesn't work with special characters
Reply: 1

ColdFusion CFLOCATION doesn't work with special characters

Adrian Ciocălău
Adrian Ciocălău Published in 2017-12-06 09:18:00Z

This question already has an answer here:

  • Redirect to UTF-8 URL with ColdFusion 2 answers

Some SEO audit tools reports same URL with different case as being duplicate content. In order to avoid this, I try to always use the lowercase version but some links were indexed with a different case, so what I am doing is to read the current URL and compare it with the lowercase version. If it's different I am doing a 301 redirect - using CFLOCATION tag to the lowercase version. So far so good with this exception...

I had to use the picture because even here I couldn't copy-paste the URL just like you see it above. Instead the paste will make it look like this:


I am using this code to do the 301 redirect:

<cflocation url="#VARIABLES.correct_url#" statuscode="301" addtoken="no">

For the above URL's it doesn't work. Any ideas? I have tried to encode/decode the string, but no luck.

Adrian Ciocălău
Adrian Ciocălău Reply to 2017-12-07 10:54:13Z

The right way to fix this problem seems to be the replacement of CFLOCATION tag with CFHEADER

<cfheader charset="utf-8" name="location" value="#VARIABLES.correct_url#">
<cfheader statuscode="301">

Thank you for your help @Ageax

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.544632 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO