Solved

Search Engine Friendly URL probem

Posted on 2003-11-12
9
678 Views
Last Modified: 2013-12-24
An earlier discussion ( http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20791920.html ) has an answer as to how to subsitute
myurl.cfmparam1=pval1&param2=pval2so that
myurl.cfm/param1/pval2/param2/pval2
is the URL

I implemented the solution BUT there appears to be a problem when the browser is Mozilla or IE5.x - and possibly others. It works OK with IE6 and NS6

The calling page contains something like this
<a href="mb3/viewmessagesns.cfm/Forum/#Getposts.ForumID#/Topic/#Getposts.TopicID#/sortby/#checkmember.sortby#>linkname</a>
and the called page uses the following to decipher the URL

<cfscript>
   debug = 0;
   valid_extensions = "html,htm,cfm,asp,jsp";
   url_suffix = ".html";
   path_to_parse = replacenocase(cgi.path_info, cgi.script_name, "");
   if (listlen(path_to_parse, "/") gte 2) {
      var_name = "";
      for (x = 1; x lte listlen(path_to_parse, "/"); x = x + 1) {
      if (var_name eq "") {
         var_name = trim(listgetat(path_to_parse, x, "/"));
         if (not refind("^[A-Za-z][A-Za-z0-9_]*$", var_name)) {
            var_name = "";
            x = x + 1;
         }
      }
      else {
           value_to_set = listgetat(path_to_parse, x, "/");
           if (trim(valid_extensions) neq "" and x eq listlen(path_to_parse, "/")) {
               for (ext = 1; ext lte listlen(valid_extensions); ext = ext + 1) {
                     extension = "." & listgetat(valid_extensions, ext);
                     if (right(value_to_set, len(extension)) eq extension) {
                          value_to_set = left(value_to_set, len(value_to_set) - len(extension));
                          url_suffix = extension;
                          break;
                     }
            }
      }
  setvariable(var_name, value_to_set);
  if (isdefined("debug") and debug) {
     writeoutput("<!-- " & var_name & " = " & value_to_set & " -->" & chr(10));
  }
  var_name = "";
  }
 }
}
</cfscript>

Any help appreciated!






0
Comment
Question by:kjuliff
  • 5
  • 2
  • 2
9 Comments
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
Instead of "/" - definitely not a good idea.. use the words AND and EQ

myurl.cfm?param1=pval1&param2=pval2

becomes

myurl.cfm?param1EQpval1ANDparam2EQpval2

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
Oops instead of AND use AMP

myurl.cfm?param1EQpval1AMPparam2EQpval2

CJ
0
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
I don't think you understand. I want the search engine friendy url with the / instead of the ?

Why would what I have done NOT work in IE5?
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
My company just redid all their links to make them search engine friendly and we still use the ? but replaced the & with AMP and = with EQ

What makes you think that the ? will throw off search engines.

CJ
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
Are you using IIS or Apache redirects?
http://www.devarticles.com/art/1/506
http://www.smalig.com/url_rewrite-en.htm

A good article I just read that explains this:
http://www.seoconsultants.com/articles/1000/url-rewriting.asp

Can you post your site url so I can test it?

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
Did you setup the CF Server to replace the "?" with "/"

CJ
0
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
I think  that the ? throws off the SEs as I've read that it does. In the article you suggested (http://www.seoconsultants.com/articles/1000/url-rewriting.asp) - very good article - thank you! - it also states this.

I don't have a public site so can't give you the URl. Actually I can't reproduce the problem myself but am told by some visitors...
0
 
LVL 17

Accepted Solution

by:
anandkp earned 500 total points
Comment Utility
Hi,

u cld use sesConverter for ur kinda requirement !
http://www.fusium.com/index.cfm?fuseaction=home.buildmaster&bodyFuseaction=ses.intro

for having "/" in ur URL's ... just take a look at it & see if it meets ur requirement !

K'Rgds
Anand
0
 
LVL 17

Expert Comment

by:anandkp
Comment Utility
:)

Cheers
Anand
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

11 Experts available now in Live!

Get 1:1 Help Now