ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search results include bad links

May 24, 2012 2:54pm

Subscribe [2]
  • #1 / May 24, 2012 2:54pm

    Bruce Brown

    74 posts

    When using the simple or advanced search forms, the first several search results show links with session strings.  None of these session string results work—they link to my 404 page.  The remaining search results in the list do not show session strings and connect fine to their respective pages.

    Only the first few links like this one fail:

    h**p://www.domainname.com/quick_piano_4fba9b2e4c5cd9.98946316

    —> goes to 404 page

    Later in the search result list the same quick piano is listed correctly:

    h**p://www.domainname.com/store/quick_piano

    —> goes to correct page

    My search code is this:

    {exp:search:simple_form search_in="everywhere" result_page="content/results"}<b>Search by keywords:</b>
    <input type="text" name="keywords" value="" class="input" size="18" maxlength="100" />
           
    
         <input type="submit" value="submit"  class="submit" /></p>
    
    <a href="http://{path=search/index}">Advanced Search</a>
    {/exp:search:simple_form}

    My results page is in my default template group and includes this code:

    <h1>{lang:search_results}</h1>
    
    <b>{lang:keywords}</b> {exp:search:keywords}
    
    <b>{lang:total_search_results}</b> {exp:search:total_results}
    
    <div id="search">
    
    <ol>
              {exp:search:search_results switch="resultRowOne|resultRowTwo"}
    <li class="{switch}">
     <dl>
      <dt><a href="http://{if">{title}</a></dt> 
     <dd class="date">{entry_date format="%M. %d, %y"}</dd>
     <dd class="excerpt">{excerpt}</dd>
     </dl>
    </li>
    <div class='paginate'>
        {paginate}
            Page {current_page} of {total_pages} pages {pagination_links}
        {/paginate}
        </div>
    {/exp:search:search_results}

    I’ve tried turning off my removal of index.php to no avail.

     

  • #2 / May 25, 2012 12:36pm

    Shane Eckert

    7174 posts

    Hello Bruce,

    I am sorry to hear you are running into this problem.

    Do you have anything else in your .htaccess file? If so can you list that here?

    Can you list out the Add-Ons that you currently have?

    Thank you,

  • #3 / May 25, 2012 12:51pm

    Bruce Brown

    74 posts

    I removed use of the .htaccess file altogether, added back index.php to the General Configuration and still had the problem.  (Now I’m back to using .htaccess.) Anyway, here is my .htaccess:

    RewriteEngine on
    RewriteCond $1 !^(cgi-bin|cosys|css|digital_products|docs|ee_folders|ee_wizard|foxycart_templates|images|static|themes|admin\.php|foxycart\.html|index\.html|index\.php|offline\.html|path\.php|google36e1de0ffaa74de9\.html|phpinfo\.php|sitemap\.php|robots\.txt) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    php_value memory_limit 32M
    
    ##EE Spam Block
    SetEnvIfNoCase Referer ".*(\+\+\+|-2000\.info|-2001\.info|-2002\.info|-2003\.info|-2004\.info|-2005\.info|-4all|-4u\.net|-4you|-adult\.|-blackjack\.|-buy-|-car-insurance|-cheap|-cock|-consolidation-|-cum\.|-deals-|-deals\.|-kasino\.|-keno\.|-loan\.|-loans-|-loans\.|-milf-|-milf\.|-mortgage\.|-online\.html|-pharma-|-pharmacy\.|-pills|-poker-|-poker\.|-prescription\.|-slut|-tamiflu-|-uncovered\.com|\.adspoll\.com|\.adult-|\.bignews\.com|\.brandimensions\.|\.cum-|\.g888\.com|\.istarthere\.|\.phuck|\.poker-|\.poker4|\.proboards|/amateur-milf\.).*" BadRef
    . . . 
    SetEnvIfNoCase REMOTE_ADDR "^(84\.230\.158\.85|84\.44\.140\.121|84\.44\.251\.50|84\.45\.128\.76|84\.69\.95\.240|84\.9\.191\.2|84\.9\.60\.32|85\.142\.33\.202|85\.180\.244\.93|85\.186\.223\.120|85\.192\.209\.204|85\.50\.35\.120|86\.112\.167\.222|86\.112\.171\.175|86\.112\.174\.204|86\.112\.191\.141|86\.123\.198\.164|86\.96\.226\.|87\.118\.120\.23|87\.164\.203\.185|87\.219\.170\.50|87\.234\.234\.66|87\.248\.231\.134|87\.98\.222\.91|88\.218\.74\.4|88\.235\.2\.12|89\.138\.18\.21|89\.149\.224\.80|89\.149\.241\.|89\.217\.36\.220|90\.156\.169\.215|90\.156\.169\.224|90\.200\.204\.203|91\.124\.171\.89|92\.112\.205\.37|92\.241\.168\.|92\.241\.169\.).*" BadIP
    SetEnvIfNoCase Referer ".*(\.domainname\.com).*" GoodHost
    SetEnvIfNoCase Referer "^$" GoodHost
    SetEnvIfNoCase Referer ".*(www\.domainname\.com).*" GoodHost
    order deny,allow
    deny from env=BadRef
    deny from env=BadIP
    allow from env=GoodHost
    ##End EE Spam Block

    (Third-party Add-ons:  Cartthrob; CP Analytics, Deeploy Helper, Sitemap, Devot.ee update manager, NSM add-on updater, NSM Better Meta; Freemember; Edit this; Selected; ImageSizer; Low Replace; Dry Accessible Captcha.)

  • #4 / May 30, 2012 4:08pm

    Shane Eckert

    7174 posts

    Hey Bruce,

    With the .htaccess file moved aside you did a search and those links were still being generated?

    If this is the case, we may need to login and look around a bit.

    Please let me know,

  • #5 / May 30, 2012 4:22pm

    Bruce Brown

    74 posts

    Yes, after I removed .htaccess I had the same problem.

  • #6 / Jun 01, 2012 5:48pm

    Shane Eckert

    7174 posts

    Hey Bruce,

    Can you please disable the captcha and test. I know that sounds odd, but it does mess with sessions.

    One more thing. Are you using session on the front end?

    Thank you,

  • #7 / Jun 01, 2012 7:03pm

    Bruce Brown

    74 posts

    I disabled captchas in the member preferences, disabled Dry Accessible Captcha and captchas in the channel settings tested and still had the problem.  I’m not using session on the front-end; cookies only.

    Thanks for helping out!  I’m confused by this one 😊

  • #8 / Jun 01, 2012 8:44pm

    Bruce Brown

    74 posts

    I’ve discovered the issue.  The search was also pulling from a channel “store-purchased items” in Cartthrob. Those entries were generating the bad links.  When I excluded that channel from this code: {exp:search:simple_form channel="channel|other channel" . . . } in the search form, the problem resolved.

    Thanks again for helping!

  • #9 / Jun 05, 2012 3:46pm

    Shane Eckert

    7174 posts

    Hey Bruce,

    Doh! I never would have gotten to that one, but this is great for future reference!

    Thank you for letting me know. Glad things are working again.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases