|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Can't get 301 permanent redirect to work properly
Author: Dave Watts
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317826
> Looks like I'll have to ask the host about this one. I have no idea what
CRLFCRLF is nor
> anything about web proxies or IIS.. a bit beyond me. And yes, the
downloading the source
> must be why it is rendered as text in the browser. Strange indeed.
"CRLF" is carriage return and line feed. Your server isn't sending
back the initial carriage return, according to Brad's Fiddler trace.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more
information!
Author: Scott Doc
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317825
Thanks Paul and Brad,
Looks like I'll have to ask the host about this one. I have no idea what CRLFCRLF
is nor anything about web proxies or IIS.. a bit beyond me. And yes, the
downloading the source must be why it is rendered as text in the browser. Strange
indeed.
Cheers
Author: brad
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317655
That's funny, when I hit the URL in IE with Fiddler on, I get the 302,
and then Fiddler throws a warning that the next header to come back is
malformed:
"The Server did not return properly formatted HTTP Headers. HTTP headers
should be terminated with CRLFCRLF. These were terminated with LFCRLF."
~Brad
>Here's my actual page: http://www.wildasia.net/rt/
OK, I believe one of two things may be happening:
1. Is there a web proxy somewhere in the chain? If possible, try it
again from a web browser right on the server.
2. Your IIS install/ColdFusion connector is hosed. Not only do I get a
302 redirect from your link, but the page it redirects to, main.cfm
doesn't render in the browser, instead I get prompted to download the
source file (which it does, yikes!). That looks like an IIS problem.
Paul Cormier
Author: Paul Cormier
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317645
>Here's my actual page: http://www.wildasia.net/rt/
OK, I believe one of two things may be happening:
1. Is there a web proxy somewhere in the chain? If possible, try it again from a
web browser right on the server.
2. Your IIS install/ColdFusion connector is hosed. Not only do I get a 302
redirect from your link, but the page it redirects to, main.cfm doesn't render in
the browser, instead I get prompted to download the source file (which it does,
yikes!). That looks like an IIS problem.
Paul Cormier
Author: Scott Doc
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317641
I removed the <cfabort> but still the same status when checking with
firefox
return: HTTP/1.1 302 Object Moved
My code is the same as yours below (except, obviously, the value of the second
line)
Here's my actual page: http://www.wildasia.net/rt/
----- Excess quoted text cut - see Original Post for more -----
Author: Paul Cormier
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317605
I just confirmed that the following code did correctly return "HTTP/1.x 301 Moved
permanently" under CF8. Sorry no CF5 available to test:
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="http://www.besthomepro.com/">
Try removing the <cfabort>.
Paul Cormier
Author: Scott Doc
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#317593
Thanks for the responses.
First off, apologies to HouseOfFusion - I duplicated this thread because
something was wrong or slow at the time and I didn't think my posting went
through:
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58281
I downloaded the firefox plug-in, but it also reported a 302.
What's worse, the resulting page came up as a 200 - text/plain. So it rendered
the html as plain text in the browser. This didn't happen on Safari (yes, I'm a
mac user)
So, I really would like to know how to fix this. I'm using CF 5 - so I don't
think I can do a "bug report" .. too old. Also to old to implement any cool new
CF8 features. Would be nice to use CF8 .. but alas, we don't.
Author: Jochem van Dieten
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#316735
----- Excess quoted text cut - see Original Post for more -----
I have seen that behavior as well. Haven't had a chance to investigate
it and/or file a bug yet.
> Why is that? And, more importantly, does this matter?
It matters to search engines. If you want to rank high you really
shouldn't move pages around, but if you do a 301 will be picked up
much better then a 302.
What you could try is a cflocation with the statusCode attribute (new in CF 8).
Jochem
Author: Hugo Ahlenius
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#316598
| Why is that? And, more importantly, does this matter? It
| seems it has "moved" it isn't a "302 Found" but it isn't a
| 301 either... I'm confused. Why is it ignoring my cfheader statuscode?
cURL is such a handy tool:
curl -I http://www.example.net/test.cfm?page=4
Get it here, if it is not in your linux distro or cygwin installation already:
http://curl.haxx.se/
Author: Alan Rother
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#316560
Scott,
If you want to be sure it's working I'd recommend testing the headers
yourself. Open up firefox and download the HttpFox plugin. It will allow you
to see all of the raw response headers a page generates on the fly.
We had a similar project and it was the only way we could validate it to the
client. They actually wanted a way to SEE that it worked.
=]
--
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org
Author: Steve Keator
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#316548
The company that I used to work at came across the same issue a while
back. We found that it was actually the redirect tester itself, and not
the CF redirects, that was reporting 302's incorrectly. Consider
checking a few alternate sources to make sure it is not that particular
redirect tester giving you a false report.
If, for some reason, you are still seeing 302's on other redirect
testers, and you're using IIS, you might want to consider setting them
up directly within.
-S.
A while back we restructured our site. This meant adding redirects on
old pages for search engines, direct links etc.
So I added the following code on effected pages:
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location"
value="http://www.example.net/test.cfm?page=4">
<cfabort>
Recently I checked our redirects with a tool found here:
http://www.seoconsultants.com/tools/headers.asp
It reported that it was receiving an HTTP Status Code of: HTTP/1.1 302
Object Moved
Why is that? And, more importantly, does this matter? It seems it has
"moved" it isn't a "302 Found" but it isn't a 301 either... I'm
confused. Why is it ignoring my cfheader statuscode?
Author: Scott Doc
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:58282#316535
A while back we restructured our site. This meant adding redirects on old pages
for search engines, direct links etc.
So I added the following code on effected pages:
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="http://www.example.net/test.cfm?page=4">
<cfabort>
Recently I checked our redirects with a tool found here:
http://www.seoconsultants.com/tools/headers.asp
It reported that it was receiving an HTTP Status Code of: HTTP/1.1 302 Object
Moved
Why is that? And, more importantly, does this matter? It seems it has "moved" it
isn't a "302 Found" but it isn't a 301 either... I'm confused. Why is it ignoring
my cfheader statuscode?
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||