SEO Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsOtherSEO Scripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old June 6th, 2003, 02:20 PM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Grab URI from address line?

I want to create a custom 404 error page. Lets say somebody tries to goto a page that is not on my serever: ww.abc.com/page1. I want to create a custom message that says : [www.abc.com/page1] is not located on this server. My server is running coldfusion.

Any suggestions would be greatly appreciated.

Thanks in advance for the help
__________________
Dman
www.concreteorange.com

Reply With Quote
  #2  
Old June 6th, 2003, 04:47 PM
ilili ilili is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Planet Earth
Posts: 193 ilili User rank is Private First Class (20 - 50 Reputation Level)ilili User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 13 h 44 m 37 sec
Reputation Power: 8
in cfadmin set your missing template. in that template pull the CGI.Server_Name and CGI.Path_Info variables and output them like:
#CGI.Server_Name##CGI.Path_Info#


Reply With Quote
  #3  
Old June 9th, 2003, 12:25 PM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Page returns with no dynamic content

I inserted the code and then page returns but there is not any dynamic content being pulled? Any suggestions?

Reply With Quote
  #4  
Old June 9th, 2003, 03:50 PM
ilili ilili is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Planet Earth
Posts: 193 ilili User rank is Private First Class (20 - 50 Reputation Level)ilili User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 13 h 44 m 37 sec
Reputation Power: 8
whats not being pulled?? the cgi var's??

did u wrap those vars with cfoutput??

<CFOUTPUT>#CGI.Server_Name##CGI.Path_Info#</CFOUTPUT> is not located on this server.


Reply With Quote
  #5  
Old June 10th, 2003, 07:27 AM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Here is the code I am using. I tried it without the <cfset> and it did not help either.

Any suggestions would be great. My site is in my profile and the page is error.cfm.

<p> The document you requested, <cfoutput> <cfset varURL = "http://" & #cgi.SERVER_NAME# & #cgi.PATH_INFO#> </cfoutput> was not found on this server. This
error can occur when:
<ul>
<li> The webmaster of www.example.com moves or deletes a document
<li> The URL is typed in wrong
<li> There is a typo in a link on some other web page
</ul>
Please double-check that you typed in the URL correctly, if applicable.
If you are unable to correct the problem, then you may wish to contact
the web administrator of http://www.example.com. To do so, send your
message to <a href="mailto:example.com">Example</a>.
If you do send mail, <b>be sure and include the offending URL</b>,
<cfoutput> <cfset varURL = "http://" & #cgi.SERVER_NAME# & #cgi.PATH_INFO#> </cfoutput>
in the text of your message!
<p> Alternately, you may return to the home page of <a href="http://www.example.com/">Example</a>.
<p> <a href="mailto:mail@example.com">Send mail to example@example.com</a><br>
<a href="http://www.example.com/">Visit the www.example.com home page</a>
<p>

Reply With Quote
  #6  
Old June 10th, 2003, 07:43 AM
dazzlindonna's Avatar
dazzlindonna dazzlindonna is offline
Contributing User
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2003
Location: Louisiana, USA
Posts: 3,876 dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 6 Days 4 h 22 m 36 sec
Reputation Power: 15
Try this instead...

<p> The document you requested, http://<cfoutput>#cgi.SERVER_NAME# #cgi.PATH_INFO#</cfoutput> was not found on this server. This
error can occur when:
blah blah blah
__________________
Military Singles Dating

Reply With Quote
  #7  
Old June 10th, 2003, 07:48 AM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Getting closer that pulls back the URI of the error.cfm page not the page that did not exist on the sever.

Here are the results:The document you requested, http://www.mavpac.com /error.cfm was not found on this server. This error can occur when:

Reply With Quote
  #8  
Old June 10th, 2003, 07:58 AM
dazzlindonna's Avatar
dazzlindonna dazzlindonna is offline
Contributing User
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2003
Location: Louisiana, USA
Posts: 3,876 dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 6 Days 4 h 22 m 36 sec
Reputation Power: 15
perhaps the http_referer variable is what you are really looking for. try it instead of the pathinfo variable.

Reply With Quote
  #9  
Old June 10th, 2003, 08:06 AM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Here is the code I used <cfoutput> #cgi.SERVER_NAME#/#cgi.HTTP_REFERER# </cfoutput>


It returns my server name but not the referer page that the error came from?

Any ideas?

Reply With Quote
  #10  
Old June 10th, 2003, 08:16 AM
dazzlindonna's Avatar
dazzlindonna dazzlindonna is offline
Contributing User
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2003
Location: Louisiana, USA
Posts: 3,876 dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 6 Days 4 h 22 m 36 sec
Reputation Power: 15
well, if you just typed error.cfm into the address bar, then there is no referrer page. it didn't come from a link on a previous page. i'm not sure there is a cgi variable that will give the nonexistant page name.

Reply With Quote
  #11  
Old June 10th, 2003, 08:35 AM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
But error.cfm is just a redirect of any 404 error. So error.cfm really never gets pulled just the invalid page. So what I need to be able to do is to pull the URI of the page that was orginally pulled.

Example:

www.mavpac.com/help

click here to see what I mean. error.cfm gets pulled but is not shown in URL box.

Reply With Quote
  #12  
Old June 10th, 2003, 08:41 AM
dazzlindonna's Avatar
dazzlindonna dazzlindonna is offline
Contributing User
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2003
Location: Louisiana, USA
Posts: 3,876 dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level)dazzlindonna User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 6 Days 4 h 22 m 36 sec
Reputation Power: 15
since the "page that was originally pulled" never really was pulled because it didn't exist, that probably won't work. the only way i can think of doing this that *might* work, is if you add a variable to all links that specifies the page name and then use that url.variablename in your error page. but this won't help if someone just types the wrong thing in the address bar and doesn't go through a link at all. I really think you will need to just stick to a more generic message such as,

the document you requested does not exist on this server. (without mentioning which document they requested)

Reply With Quote
  #13  
Old June 10th, 2003, 08:42 AM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Now when I use this code
<cfoutput> #cgi.SERVER_NAME# #cgi.PATH_INFO#</cfoutput>
It shows the error.cfm page even though in the URL box is displays the page not found on server.

Reply With Quote
  #14  
Old June 10th, 2003, 08:44 AM
derekwit derekwit is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 69 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 7 sec
Reputation Power: 8
Dazzl,
I was trying but I guess you are right I will just stick to a generic page.

Thanks for the help!!

Reply With Quote
  #15  
Old June 10th, 2003, 08:44 AM
cindik's Avatar
cindik cindik is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Chicago, IL
Posts: 48 cindik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
here's a snippet of what I use for the 404 page on the Mikes of Chicago site (it's PHP):


Code:
            <?
                if(!$HTTP_REFERER) {
                    $source = USER;
                }
                elseif(substr_count($HTTP_REFERER,$SERVER_NAME) > 0) {
                    $source = INTERNAL;
                }
                else {
                    $source = EXTERNAL;
                }
             ?>
 

        <H2>
            <?
                if($source == "USER") {
                    echo "404 - incorrect URL entered";
                }
                elseif($source == "INTERNAL") {
                    echo "404 - Internal link broken";
                }
                elseif($source == "EXTERNAL") {
                    echo "404 - Invalid link from $HTTP_REFERER";
                }
            ?>
            
        </H2>
        <? 
            if($source == "USER") {
                echo "You seem to have typed the url incorrectly.<br>We will take you to our home page at <a href=\"http://$SERVER_NAME\">$SERVER_NAME</a>.";
            }
            elseif($source == "INTERNAL") {
                echo "Whoops!  We seem to have a broken internal link.<br>";
                echo "Please tell the webmikester (<a href=\"mailto:webmike@mikesofchicago.org\">webmike@mikesofchicago.org</a>).<br>";
                echo "We will return you to <a href=\"$HTTP_REFERER\">$HTTP_REFERER</a>.";
            }
            elseif($source == "EXTERNAL") {
                echo "The page $HTTP_REFERER sent you to a page which doesn't exist on this site (${SERVER_NAME}).<BR>";
                echo "You may want to tell the site's webmaster to correct the link.<BR>";
                echo "We will take you to our home page at <a href=\"http://$SERVER_NAME\">$SERVER_NAME</a>.";
            }

        ?>

Reply With Quote
Reply

Viewing: SEO Chat ForumsOtherSEO Scripts > Grab URI from address line?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 8 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek