Solved

Search Engine Friendly URL probem

Posted on 2003-11-12
9
700 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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