?
Solved

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

Posted on 2007-04-09
11
Medium Priority
?
823 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

765 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