Solved

Search Engine Friendly URL probem

Posted on 2003-11-12
9
711 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
ID: 9732179
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
ID: 9732187
Oops instead of AND use AMP

myurl.cfm?param1EQpval1AMPparam2EQpval2

CJ
0
 
LVL 1

Author Comment

by:kjuliff
ID: 9732381
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 19

Expert Comment

by:cheekycj
ID: 9732410
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
 
LVL 19

Expert Comment

by:cheekycj
ID: 9732500
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
ID: 9732545
Did you setup the CF Server to replace the "?" with "/"

CJ
0
 
LVL 1

Author Comment

by:kjuliff
ID: 9732844
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
ID: 9737248
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
ID: 9745209
:)

Cheers
Anand
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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