URL rewriting and Google Yahoo Spider (1)

Source: Internet
Author: User
URL rewrite and Google spider

We know that we need to take some measures to search engines for websites. At least we need to rewrite the URL. But the problem is.
We found that Google Yahoo spider could not catch the webpage Baidu.

All are 500 errors or 302 errors .. dizzy.

I had to write down the error.

Void application_error (Object sender, eventargs E)
{
Exception error = server. getlasterror ();
String Path = server. mappath (datetime. Now. tow.datestring () + "error. log ");
System. Io. streamwriter Sw = new system. Io. streamwriter (path, true );
Sw. writeline ("datetime:" + datetime. Now + "\ t" + error. tostring ());

For (INT I = 0; I <request. Params. Count; I ++)
{
Sw. writeline (request. Params. Keys [I] + ":" + request. Params [I]. tostring () + "");
}
Sw. writeline ("End \ r \ n ");

Sw. Close ();

}

It turns out that
System. Web. httpunhandledexception: raises an exception of the type "system. Web. httpunhandledexception. ---> System. Web. httpexception: cannot use the leading... to exit from the top-level directory. This error occurs. Search for it and immediately find someone has encountered this problem.

Cause

Because urlrewirter is used, Google's search engine does not support cookies, so Asp.net will automatically Insert the session ID into the returned URL, so that search crawlers can use it .. when returned to the parent directory, an error occurs.

Solution

1. Set cookieless =Usecookies,Whether or not the client supports cookies, use cookies.

2. Because the default cookieless =UsedeviceprofileSo you can create a device file. browser for the search engine to resort to fraud. "Get googlebot to crash your. NET 2.0 site" provides such an approach.

3. modify the program and set the relative path (~ /) Change to absolute path representation (you can use the resolve method ).

Http://www.cnblogs.com/hjf1223/archive/2006/10/14/529227.html has a more detailed description

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.