Solved

Rewrite friendly URLs using Custom ASP 404 error page - is it search engine safe?

Posted on 2007-04-09
11
802 Views
Last Modified: 2013-12-08
Hi,
I'm using a custom 404 ASP error page to rewrite friendly-style URLs to standard asp ones, and I then use server.transfer to call the actual page.
eg. www.mysite.com/london.htm (which doesn't exist)
invisibly becomes
www.mysite.com/cities.asp?name=london (which does exist)
My question is this - is there any danger that search engines will recognise this as a 404 not found error and so not bother indexing it, or does server.transfer fully hide the fact?
Many thanks.
Nige
0
Comment
Question by:nigelhayler
  • 5
  • 4
  • 2
11 Comments
 
LVL 25

Expert Comment

by:kevp75
ID: 18876674
I would imagine it would not be SEO.

The search engine will go to that page, and no matter how hard you try (unless you use a component), the initial headers that get sent to the browser is that of a 404 (page does not exist) error.  Which is exactly what the search engine will see.  That the page does not exist...
0
 
LVL 4

Accepted Solution

by:
opho earned 125 total points
ID: 18876861
Hey nigelhayler...

My experience differs from kevp75's on this.

I'm using essentially the same technique you describe at this site:

http://www.purposeproject.org/FAQ

There is no page named FAQ.  My default.asp page is set up as my custom 404 page.  It looks at the database to determine where the content is for the page.  In the past I have retrieved the content and written it out with response.write statements directly from default.asp.  Currently, I am doing what you describe -- putting parm values in a couple of session variables and doing a server.transfer to the actual page.

I've tested using this SEO utility:

http://www.seoconsultants.com/tools/headers.asp

which tells me that the HTTP response is HTTP/1.1 200 OK

And, I'm not having any trouble getting placement in search engine results for this and another couple of client sites.

If anybody has specific experience or information that I'm reading my circumstances incorrectly, I'd love to hear about that.  But, I don't see any reason why you'd be running into problems with search engines based on what you've described.

--Steve
0
 

Author Comment

by:nigelhayler
ID: 18877040
Thanks kevp75 and Steve,
I wondered about all of this - a sudden chill went down my spine, having reworked my site to allow friendly URLs, when I thought what if the dreaded 404 gets through to the search engine? On the face of it, it does seem like it should, but I've just tried the utility you suggested Steve, and I get the same - 200 OK. Does this suggest that a custom 404 doesn't return 404 in the header at all? I wonder if anyone has used it, and found it does create a problem?
Nige
0
 
LVL 25

Expert Comment

by:kevp75
ID: 18877164
personally i haven't even tried url re-writing  (other than with a component...)

It does seem like it should, however (if) Steve's pages are the custom 404 errors, I was able to spider them with no problem...so...looks like you should be good to go..
0
 
LVL 4

Expert Comment

by:opho
ID: 18877511
My understanding of custom error handling in IIS is that it is exactly that:  Instead of taking control over what should be done when a 404 error is triggered, IIS hands control over to the specified page.

When our ASP page takes control over redirecting to an actual page, we should still be generating our own 404 error if the requested content is not available.  We do that by writing out whatever we wish for page content and specifying our own status code.

For example, if the URL requested is obsolete because it's been replaced by a page at a new address, we should issue a 301 response as follows:

    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "http://www.mydomain.com/NewPage.html"

This code redirects the browser to the correct page AND tells the browser as well as search bots that they should update their records to show the new address.

And, when a nonexistent page is requested, so we need to trigger a 404, we need to use:

    Response.Status="404 Moved Permanently"
    Response.Write [A page with the error message and links to the home page and site search page]

So, the answer to "a custom 404 doesn't return 404 in the header at all?" is "Exactly, unless we tell it to do so in our code."

--Steve
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 4

Expert Comment

by:opho
ID: 18877745
Ooops, obviously the second response.status should have been:

Response.Status="404 Not Found"

--Steve
0
 

Author Comment

by:nigelhayler
ID: 18877809
Thanks Steve, that's something extra I'll bear in mind for a simple custom 404 Not Found page - to ensure the correct header is returned.

On the original question of friendly URL re-writes - I'm so glad I haven't wasted time today - I can pack up for the day happy! Thanks to you both.
0
 
LVL 25

Expert Comment

by:kevp75
ID: 18877981
So, curiosity has a grip now....what happens when a client requests a page that does not exist?

Does the code on the custom 404 page send it into an endless loop, or would you simply setup some error checking?
0
 
LVL 4

Expert Comment

by:opho
ID: 18878148
Nope, IIS doesn't get involved again if the custom page sets the status to 404.
0
 
LVL 25

Expert Comment

by:kevp75
ID: 18878366
ahh....good stuff to know...thanks opho
0
 
LVL 25

Expert Comment

by:kevp75
ID: 18878373
p.s.   I'm just outside of Springfield, MA   ;-)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now