![]() |
| 404 type error on coldfusion |
|
calidude
|
I have several coldfusion storefronts hosted on HMS. Many have been moved and rebuilt from prior storefronts so the search engines are serving up old coldfusion pages. For the standard html pages I just put up a custom 404 page but for the coldfusion pages I have not foud a solution. I did find and older post about the application.cfm page but am worried about putting any code there since one already exists for the storefront application. Does anyone have any ideas how I can redirect customers who enter the site through an old cf page? This causing loss of business for some of my ecommerce clients.
Thaniks in advance for the input. Bob |
||||||||||||
|
|
|||||||||||||
| CFHeader |
|
Jason101
Forum Regular
|
Hey there.
It's OK to use multiple Application.cfm files in one application. Coldfusion goes up the directory tree until It finds an Application.cfm. But keep in mind, the second Application.cfm won't have access to any variables set in the first application.cfm You would have to duplicate everything in the first to the second in order to access the variables. Secondly, You really shouldn't put 404 errors up. You should generate custom HTTP response headers to return to the client and to Google/Search Engines by using CFHeader. For instance, if you moved a page and wanted to redirect the user, one might use
Although that works good for a user, search engines don't like redirects to other pages. So you should use <cfheader> as follows:
This will tell search engines that your page has moved, and to re index the page at the new location. For a user, it is completely transparent and they will just be redirected. If I confused you about the application.cfm, let me know and I'll give you a better example. Hope this helps. |
||||||||||||||||
|
|
|||||||||||||||||
|
calidude
|
I am a little confused on the application.cfm. Would both exist in the same directory?
Thanks again. |
||||||||||||
|
|
|||||||||||||
| Directories |
|
comprug
Forum Regular
|
Hello, to address your concerns, one Application.cfm would go in the root of your site, but one would go in the old directory to redirect people. The root application.cfm will be in charge of everything except the old directory, as CF looks first in the directory the user is in, and then on a global level. Hope this addresses your concerns. |
||||||||||||||
|
|
|||||||||||||||
| Oops |
|
Jason101
Forum Regular
|
Sorry for the confusion. Thanks for the clarification Comprug
|
||||||||||||
|
|
|||||||||||||
| 404 type error on coldfusion |
|
||
|


