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

I'm finding that CF9 doesn't redirect accurately on pages with hyphen in name

New Here ,
Oct 18, 2009 Oct 18, 2009

I've just loaded CF9 on a development server and run some sites thatt worked perfectly on CF8.

Here's the problem:

<cflocation url="/users/listings/EditListing-2.cfm" addtoken="no" statuscode="301">               

<cfabort>

or

<cfheader statuscode="301" statustext="Moved Permanently">
<cfheader name="Location" value="/users/listings/EditListing-2.cfm">
<cfabort>

I've been using this page naming format for years in applications where you have step 1, step 2 and so on.

Running either of the above on a page under CF9 redirects to the site root or Index.cfm.

If I change the page name to EditListing2.cfm it works as intended.

Has anyone else had this probelem and do you have an easy fix, apart from renaming many many pages on over 45 websites?

Looking for any ideas.

Old Tony

746
Translate
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 ,
Oct 18, 2009 Oct 18, 2009

Looking for any ideas.

Check your virtual directories, because I think you might have something bung.  If I set up what you describe, it works fine for me.

Can you browse to http://your.domain.here/users/listings/EditListing-2.cfm ?

--

Adam

Translate
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 ,
Oct 19, 2009 Oct 19, 2009

No I'm very confident mapping to a virtual directory is not the cause. There are no virtual directory or mapping errors when the URL doesn't have a hyphenated name.

I have a CF8 server set up identically and all the code works fine and I never get this problem. When I run any URL that leads to a cfm file with a hyphenated name on my CF9 installation, it defaults to the Index.cfm page. This is the release version of CF9.

Translate
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 ,
Oct 19, 2009 Oct 19, 2009

Hmmm.

Well it's unlikely to be a behavioural thing that manifests differently from one CF install to another... there's not enough "moving parts", if you see what I mean.

* What's your exact file structure (reflecting the calling code, and the location of the target file)?

* What're the relevant virtual directories (humour me)?

* Do you get the same behaviour using the JWS as opposed to Apache or IIS (which is it, btw?)

* What sort of CF9 install is it (stand-alone / multi-server; standard  / dev / enterprise)?

* As per my previous post... can you actually browse to the target file via the same URL you are specifying in your code?

*  Have you put an HTTP sniffer into action to see if anything odd is happening @ HTTP level?

* Anything unexpected in the web server, CF or JRun

--

Adam

Translate
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 ,
Oct 19, 2009 Oct 19, 2009

Thanks for the suggestions Adam.

If you're the same AC I think you are, I've been developing in CF for about

3.5 years longer (since around 1997) however old age and boredom makes one

(me)careless. I just installed CF9 developer version as I always do, bang,

bang, bang without much concentration.

It looks like I erred. I've been thinking about it during the night and I

think maybe you're right, there's a mapping problem.

I'm now deleting the CF9 install and starting again. This time I'll be more

careful.

I jumped to the conclusion of hyphenated file names as being the problem due

to experiences with ASP .Net where I've found it to be a big problem in some

circumstances. I also once had to contract migrate 9 CF4.0 installs to CF

MX6 and ran into lots of obstacles with segmented references due to how JAVA

treated dots.

I pounced on these experiences as the reason, and blamed CF9.

In theory there shouldn't be a problem with CF9, if it worked on CF8.

PS I can't post any of the code as I'm "under non disclosure" on a

government project. If the new install doesn't work, I'll post similar code.

Thanks for the thoughts.

Old Tony

Translate
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 ,
Oct 19, 2009 Oct 19, 2009

Hi Tony.

I think there's only one of me (the likes of BKBK are probably thinking "thank god for that!"), so I'm probably the one you think I am.  I don't recognise who you are form your "handle" though.  And, yeah, I've been doing CF since about 2001.

Glad you got it sorted.

When I asked for steps to repro, you shouldn'tve needed to post any confidential code: I'm not interested in all the secret goings on, just the file structure, mappings, and a coupla lines of code to demonstrate the problem.  So all the secret code should be factored out of a repro case anyhow.  Something to think about for next time, perhaps.

Anyway, glad you got it sussed.

--

Adam

Translate
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 ,
Oct 19, 2009 Oct 19, 2009

This is now solved. There is no problem such as this in CF9. The problem is in me the developer. I was rebuilding a site and copied some code from a previous version incorrectly.

30 years of code development demonstrates that familiarity does breed contempt as well as carelessness.

Old Tony

Translate
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 ,
Oct 19, 2009 Oct 19, 2009
LATEST

I'd probably do something like that at least once a week.  So you're in company there (I'd not go as far as to describe it as "good company").

Goes to show how a second pair of eyes - even ones no-where near your screen - can help out sometimes.

--

Adam

Translate
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