120 likes | 209 Views
Search Engine Safe URLs. presented by Ben Ellefson ben@elfpro.com. Definitions. Static URL A static URL is a URL that contains no variables, even is the page itself is dynamic. (i.e. www.website.com/index.cfm) Dynamic URL A dynamic URL is a URL that contains variable name pairs.
E N D
Search Engine Safe URLs presented by Ben Ellefson ben@elfpro.com
Definitions • Static URL • A static URL is a URL that contains no variables, even is the page itself is dynamic. • (i.e. www.website.com/index.cfm) • Dynamic URL • A dynamic URL is a URL that contains variable name pairs. • (i.e. www.website.com/index.cfm?x=1)
The Problem • Google and other search engines struggle to spider dynamic pages and do not fully index them. • This can lead to significantly less visibility on Google and other search engines.
The Solution • Trick the search engines into thinking your dynamic URL is a Static URL. • This is done by reformatting the URL • Change: www.website.com/index.cfm?x=1 • To: www.website.com/index.cfm/x:1/index.html
Execution • Step 1 • Reformat your URLs • Step 2 • Create function to extract the url scope variables.
Step 1 • Convert all ? And & to / • Convert all = to : • Add full path (http://www.website.com/) to the beginning of all links and file paths. • Add /index.html at the end of all links.
Reformatted Code Change: <a href=“Index.cfm?fuseaction=Customer.Login”> To: <cfset FullPath = “http://www.website.com/”> <cfouput> <a href=“#FullPath#Index.cfm/fuseaction:Customer.Login/index.html”> </cfoutput>
Step 2 • Create User Defined Function to extract the url scope variables. • http://www.fusionauthority.com/Techniques/4226-Search-Engine-Safe-SES-URLs.htm • This function must be called in the Application.cfm
UDF Code function SES() { var UrlVars=ReReplaceNoCase(trim(cgi.Path_Info), '.+\.cfm/? *', ''); var loopcount=ListLen(urlvars, '/'); var potential=""; if (cgi.script_name EQ cgi.path_info) return 0; for(i=1;i LTE loopcount; i=i+1) { potential=trim(listgetat(UrlVars, i, '/')); if (ReFindNoCase('^[a-z][a-z0-9_]*:.*', potential)) SetVariable('URL.'&listfirst(potential,':'),listlast(potential,':')); } return 1; } This function was created by Michael Dinowitz and posted in Fusion Authority article located at http://www.fusionauthority.com/Techniques/4226-Search-Engine-Safe-SES-URLs.htm
Examples • www.BeginPage.com • A free web portal where users can fully customize the style and every link displayed. • www.houndstreetbakery.com • An e-Commerce site selling specialty dog treats.
Credits PowerPoint created and presentation by Ben Ellefson, ElfPro LLC www.elfpro.com ben@elfpro.com User Defined Function created by Michael Dinowitz and posted in Fusion Authority article located at http://www.fusionauthority.com/Techniques/4226-Search-Engine-Safe-SES-URLs.htm