Tips: Flash website SEO

Source: Internet
Author: User
Tags functions hash html page modify
seo| Tips

At present, the text in the full Flash station is difficult to capture to the general search engine (perhaps Google will improve it later), because the search engine only analyzes the text inside the HTML page (dynamic pages such as asp,php, but the priority will be relatively low), so, Flash is a disadvantage in this respect. There have been people here before about the Flash SEO problem, is implemented through XHTML, today I would like to introduce you to another method: through the Web redirect and my last tutorial on the Flash station positioning technology.

PS: These two methods in the eyes of the search engine, are cheating behavior. One is not careful, the server is not known. Therefore, we suggest that you should be careful if you really want to use these methods. I now use the server is not their own, so I am more cautious, before the page submitted to Baidu, I first contacted the Baidu Webmaster, until he replied I dare not start action.
Positioning Technology : http://www.webjx.com/htmldata/2006-08-21/1156119565.html

A successful demo of the results:
Http://www.baidu.com/s?wd=site%3Ahbro.cincn.com&cl=3
This is the Baidu included in my Site pages, point inside any of the links (it is best to choose the release time later those), you will see a whole version of the more monotonous text, in 1-2 seconds (time is determined by the speed), redirect to my Flash page, but you can notice that the text is displayed in the SWF.
Could have used meta or JS direct redirect to avoid the delay, but I was more careful to use the search engine for flash support defects, the redirection code in a Flash control, so there is a load of flash delay. So, I can only say that it is a success.
Redirects, in fact, are directed to the same address, because the entire station belongs to a single HTML page of the Flash site. Therefore, it is necessary to use the positioning technology introduced in my last article so that the text of the search results in the SWF to get the correct display, otherwise, is to deceive the user, I do not need to introduce my practice here, because as long as the false can be.

here are the steps to do this SEO :

1, first of all, we must realize that the search engine can not capture the text in Flash, so the text in Flash needs to be read externally. Here, each piece of news to make an HTML file, so that Flash can read, but also let search engines can catch. such as page1.html,page2.html,page3.html

2, in the Search Engine submission page, generally only submit the first page, and then according to the link to the home page to capture other pages. If the submission is a pure Flash page, all links, externally read files are implemented through as, the search engine will not be able to obtain additional paging address. Therefore, we need to make an HTML file, put the relevant links, if you want the user to see the Flash page at the beginning, use a redirect code, to the Flash page, and without parameters. So the flash home file named index_flash.htm,html version of the page named Index.html, and then, in index.html Add redirect code. It is not recommended to use meta, it is easy to shoot search engines. Here, you can use JS:

<script language= "JavaScript" >
location.href= "Index_flash.html"
</script>

Most insured or in Flash, with Geturl to redirect, but this will cause delay, affect the user experience.

3, capture the paging also need to redirect to the Flash page, this time need to upload parameters to flash, so the redirected address must be a parameter, and can distinguish between different pages, the best parameter is the current HTML page address. For example, add in page1.html:

<script language= "JavaScript" >
Location.href= "index_flash.html#page1.html
</script>

4, let JS Location.hash value to flash, let Flash read back to page1.html content. In JS with SetVariable to set: Index_flash.setvariable ("link", Document.location.hash.slice (1))
After flash gets to the link value, read it in Loadvars:

var lv=new loadvars ()
Lv.load (link)
Lv.ondata=function (SRC) {
Textbox.text=src
}

Some details about the 3rd and 4 points are mentioned in my first article:
Http://www.webjx.com/htmldata/2006-08-21/1156119565.html

Next, I'll do a simple demo document, combining the examples to specify the steps above.

The document has been completed, but because of the more documents involved, it is not convenient for us to test, so, first the entire production process with you described below:

1, put in your site a few HTML files, page1.html,page2.html,page3.html, please note that in order to deal with the convenience, format not too complicated. It is best to use the following format:

<title> News title </title><script language= "JavaScript" src= "Tonews.js" ></script><body> Body Content </body>

Tonews.js is a redirected code that is reused for every paging, so a file is created independently
location.href= "index_flash.html#" +document.location//the address as a parameter to the Flash page to identify.

2, the production of the search engine submitted to the homepage index.html, the page can not be Flash version, must contain page1.html,page2.html,page3.html these links, or through a few layers of HTML analysis, you can get these addresses.
index.html Example:
Then add the code in the index.html:

<script language= "JavaScript" >
location.href= "Index_flash.html"
</script>

To get your HTML page redirected to the Flash page.
Attached: index.html Example:

<a href= "page1.html" >news1</a><br>
<a href= "page2.html" >news2</a><br>
<a href= "page3.html" >news3</a><br>
<script language= "JavaScript" >
location.href= "Index_flash.html"
</script>

To do this step, as long as the submission to Baidu Index.html and is included, Baidu will be included in the page1.html,page2.html,page3.html index.

The following is how to display the content in flash through redirection.

3, create a new flash document, placed in the stage two more than a row of dynamic text box, the instance name is titles and contents, respectively, put news headlines and content.
Originally, the author intends to directly read the index.html directly into the titles text box, unfortunately, the link will jump to the page, if you want to avoid, you must through string analysis to change the link to Asfunction protocol, this method trouble, and easily affected by the content and error. So, it's better to build an XML document for Flash to read.
In the index.html directory, build an XML file News.xml

<?xml version= "1.0" encoding= "GB2312"?>
<news>
<a href= "page1.html" title= "News1"/>
<a href= "page2.html" title= "News2"/>
<a href= "page3.html" title= "News3"/>
</news>
Create a new layer in flash and add frame code:
System.usecodepage = true;
Titles.html = true;
var titleslv = new XML ();
Titleslv.load ("News.xml");
Titleslv.onload = function (success) {
if (success) {
var Titles_arr = new Array ();
var Hrefs_arr = new Array ();
Titles.htmltext = "";
for (var i in titleslv.childnodes[0].childnodes) {
Titles_arr[i] = Titleslv.childnodes[0].childnodes[i].attributes.title;
Hrefs_arr[i] = Titleslv.childnodes[0].childnodes[i].attributes.href;
}
for (var i in Titles_arr) {
Titles.htmltext + = "<br><a href=\" asfunction:loadnews, "+hrefs_arr[i]+" \ ">" +titles_arr[i]+ "</a>" ;
}
}
};

This code is to parse the XML file, not the focus of this tutorial, so no longer repeat.
One of the loadnews functions is to call the news and add the following:

var contentslv = new Loadvars ();
function loadnews (href) {
contentslv.load (HREF);
Fscommand ("setaddress", href)//Let the news load, modify the content after the Address bar #. This will be defined in JS.
}
Contents.html = true;
Contentslv.ondata = function (src) {
Fscommand ("Settitle", GetTitle (SRC))//settitle Modify the title of the page, also defined in JS. GetTitle gets the title from the HTML string. The function is defined as
Contents.htmltext = getcontents (src);//getcontents gets the body content from the HTML string, which is defined in as.

These two string parsing functions are defined below:
Format for pagination HTML:

<title> News title </title><script language= "JavaScript" src= "Tonews.js" ></script><body> Body Content </body>

function GetTitle (str) {
var beginindex=str.indexof ("<title>") +7//header starts with <title> tag
var endindex=str.indexof ("</title>")//End to </title> label
Return Str.slice (Beginindex,endindex)//tag is truncated with the slice function
}
function getcontents (str) {
var beginindex=str.indexof ("</title>") +8//body can start with </title> or you can choose <body> tag
Return Str.slice (beginindex)//marked with slice intercept.
}
};

Save FLA file to index.html directory, file name is Index_flash.fla. Then click "File"-"Publish Settings", in the HTML tab, the template Drop-down select "Flash with Fscommand tracking", and then click the "Publish" button. Then, on the Format tab, remove the HTML.

4, at this time with Notepad to open the generated index_flash.html, find//code here (places your code here), in the Index_flash_dofscommand function write:

if (command== "Settitle") {
Thetitle=args
}
if (command== "Setaddress") {
Document.location.hash=args
}

Then, define a function outside the function that sets the caption:

function Settitle () {
Document.title=thetitle
Id=settimeout (settitle,1000)
}

The reason for using the cycle callback, do not know is not the cause of the bug, often after the title, will automatically change back, or a number of # or something.
Now, you also need to call Flash's loadnews function through JS after loading. In the Flash 8 control, you can easily invoke functions through callfunction, AS3 even through Externalinterface can write as functions directly in JS, but there are still a few users of the player in the 7 phase, So first introduce the old method: SetVariable.
This method can set the value of the variable of the Flash control, but how to trigger the Loadnews function of flash by changing the quantity? Here we introduce the AddProperty method inside as.
Object.addproperty (proname:string,getter:function,setter:function)
Proname, property name.
Getter, the function that is called when the variable is read.
Setter, the function that is called when the variable is set.
We call this function by adding a property that allows JS's setvariable to execute.
As in Append:

This.addproperty ("link", Getlink,setlink)
function GetLink () {
}
function Setlink (link) {
Loadnews (link)
}

Do not know why, if do not define GetLink, this setlink also is not used, so had to put this form to get up.

So, you can add this function in JS:

function Js_loadnews () {
if (Document.location.hash.slice (1)!= "") {//If there is no parameter behind the # number
Index_flash.setvariable ("link", Document.location.hash.slice (1))//Set the link value in Flash to invoke the Loadnews function inside.
}
}

Then add onload=js_loadnews to the body tag ()
At this point, the process of redirecting to the Flash page and truly reflecting the relevant content has been completed. Although the essence is a cheating behavior, but has not deceived the user.

Finally, to Baidu submitted index.html, you can give Baidu received 4 pages. Of course, the content should be legal, otherwise it will be included in the refusal.
As for how to improve the rankings, that is the content of the problem, not the technical aspects of things, it is not discussed here. In general, the proper use of META keyword tags will have a certain effect on improving rankings.



Related Article

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.