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.

Bad Request error on one page, front end ?

September 16, 2008 7:41am

Subscribe [1]
  • #1 / Sep 16, 2008 7:41am

    smithy

    68 posts

    Hi,

    A client of ours has been seeing a Bad Request error just on one front-end page, and only in Firefox (different versions): it sometimes happens if you go to the page, close the tab then open that page again in a different tab without clearing cookies.

    Have you any clues as to why this might be happening? They’re worried because that page has dropped out of Google’s rankings. I started seeing the error after a big URL rewriting project they did, and assumed it was to do with that. The affected page isn’t really different from several others so we’re at a loss.

    A few bits of info about their setup:

    EE:  1.52 b 20070122 (won’t upgrade just yet; are rewriting index.php out of their urls also)
    Server: Win IIS/6.0

    EE Control Panel Session Type: Cookies
    EE User Session Type: Cookies

    Thanks for any advice,
    smithy.

  • #2 / Sep 16, 2008 10:31am

    Robin Sowell

    13255 posts

    How did you handle the rewrite project?  And I’m not up on windows, but can you layout what exactly is being done on that end to rewrite?  Does it only happen if you’re logged in/out?  And any chance you can link to the page in question?

    (And 1.5.2 is really back there- while it may not be relevant to this issue, I’d schedule in some time to do an update.)

  • #3 / Sep 17, 2008 7:05am

    smithy

    68 posts

    Hi Robin,

    I can get the error whether logged in or out, but not every time. I’ll PM you the link.

    Unfortunately the client is reluctant to put aside the budget to upgrade, though we’ve suggested it a few times (ironically we’ve spent quite a few hours doing custom stuff that later versions do out-of-the-box).

    They handled the rewrite project themselves, using Helicontech ISAPI Rewrite, along with the usual EE tweaks in the CP. The way they’ve done it, every URL goes through EE unless they specifically exclude it. Here are the relevant bits of the ISAPI rewrite file, should be interesting to quite a few people I would think:

    # Helicon ISAPI_Rewrite configuration file
    # Version 3.1.0.42
    
    # 301 Redirect non-www URLs to www version
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) <a href="http://www.domain.com$1">http://www.domain.com$1</a> [R=301,L]
    
    # Except for URLS with css or weblog/authors&mbr;= (author pages) in the URL, 301 redirect the URL, removing the index.php part
    RewriteCond %{REQUEST_URI} !system
    RewriteCond %{QUERY_STRING} !weblog/authors&mbr;=
    RewriteCond %{QUERY_STRING} !css
    RewriteCond %{QUERY_STRING} !search_query
    RewriteCond %{QUERY_STRING} !search=1
    RewriteCond %{QUERY_STRING} (.*)
    RewriteRule /index.php(.*) <a href="http://www.domain.com%1">http://www.domain.com%1</a>? [R=301,L]
    
    # Add trailing slash to URL if one doesn't exist
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    RewriteRule (.*)$ <a href="http://www.domain.com$1/">http://www.domain.com$1/</a> [R=301,L]
    
    [snip]
    ... rewrite duplicate content urls after site reorganisation…
    [/snip]
    
    # Rewrite URL for background use by EE (exceptions added for folders and CSS file calls through index.php)
    RewriteCond %{REQUEST_URI} !.*\.(html)
    RewriteCond $1 !^/(images|system|js|index\.php|sitemap\.xml|robots\.txt) [NC] 
    RewriteRule ^(.*)$ /index.php?$1 [I,L]

    Thanks for taking a look,
    smithy.

  • #4 / Sep 17, 2008 12:19pm

    Robin Sowell

    13255 posts

    Hm.  Not my strong point and normally I’d say remove the htaccess and test w/out it- see if you can trigger the bad request.  But w/a live site, I’m thinking that’s probably out.  And probably irrelevant.  I googled around and found this cropping up a number of places non-EE related.  Well- a bunch of causes, but I think this is maybe cookie related.  The behavior described fits with that as well.  (I searched for: Bad Request error firefox).

    Do you have a cookie domain set for EE- Admin- System Prefs- Cookies.  And- is there anything interesting on the page- ads or anything unique about it.  Can’t figure why a single page might be related to this.

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

ExpressionEngine News!

#eecms, #events, #releases