Page 1 of 1

Error Pages (401,403,404) not served for cms folder

Posted: Thu Jan 15, 2009 2:30 pm
by crankshaft
Hi;

I have a problem where the error pages are not being served for the cms folder, with every other folder, the pages are served directly.

I have also followed the guides to create these error pages in cmsms and modify the httpd.conf file, but no matter whether apache is configured with it's default error pages, or pages managed through cmsms, the error pages are not displayed.

In Firefox, I get the following error:

Code: Select all

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
    * Please contact the website owners to inform them of this problem.
In IE7 I get:

Code: Select all

Internet Explorer cannot display the webpage 
   
Most likely causes:
You are not connected to the Internet. 
The website is encountering problems. 
There might be a typing error in the address. 
I have checked the error log file and there's no error, the access log shows an uneventful connection (to a non existent page "new")

Code: Select all

[15/Jan/2009:22:19:09 +0800] "GET /cms/new/ HTTP/1.1" 404 195 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5"
Any ideas ??

Re: Error Pages (401,403,404) not served for cms folder

Posted: Thu Jan 15, 2009 11:23 pm
by Pierre M.
System Info ?
Hosting context ?
Pretty URL configuration ? Scheme ?
How to reproduce ?

Re: Error Pages (401,403,404) not served for cms folder

Posted: Wed Feb 18, 2009 4:05 pm
by DougWare
I'm having the same problem, and I believe it's related to the PrettyURLs using the RewriteEngine.

Does anyone have a fix for this?

Re: Error Pages (401,403,404) not served for cms folder

Posted: Mon Feb 23, 2009 2:37 pm
by Pierre M.
DougWare wrote: I'm having the same problem, and I believe it's related to the PrettyURLs using the RewriteEngine.

Does anyone have a fix for this?
Pierre M. wrote: System Info ?
Hosting context ?
Pretty URL configuration ? Scheme ?
How to reproduce ?

Re: Error Pages (401,403,404) not served for cms folder

Posted: Wed Mar 04, 2009 9:29 pm
by spetracco
It's caused by this line in the .htaccess:

RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Whenever you go to a page that doesn't exist. For example:

http://www.netblazon.com/doesnotexists/

Sorry I'm not sure what is meant by system info, hosting context, or scheme - if you have more details on what you need or how I get it, let me know and I'll post it here.

Re: Error Pages (401,403,404) not served for cms folder

Posted: Wed Mar 04, 2009 9:33 pm
by spetracco
Found it!

Cms Version: 1.5.1

Installed Modules:

    * CMSMailer: 1.73.14
    * FileManager: 0.4.3
    * MenuManager: 1.5.3
    * ModuleManager: 1.2.1
    * News: 2.9.1
    * nuSOAP: 1.0.1
    * Printing: 0.2.6
    * Search: 1.5.2
    * ThemeManager: 1.0.8
    * TinyMCE: 2.4.10
    * FrontEndUsers: 1.5.4


Config Information:

    * php_memory_limit:
    * process_whole_template: true
    * max_upload_size: 2000000
    * default_upload_permission: 664
    * assume_mod_rewrite: true
    * page_extension: /
    * internal_pretty_urls: false
    * use_hierarchy: true


Php Information:

    * phpversion: 4.3.9
    * md5_function: On (True)
    * gd_version: 2
    * tempnam_function: On (True)
    * magic_quotes_runtime: Off (False)
    * memory_limit: 32M
    * max_execution_time: 30
    * safe_mode: Off (False)
    * session_save_path: /var/lib/php/session (0770)


Server Information:

    * Server Api: apache2handler
    * Server Db Type: MySQL (mysql)
    * Server Db Version: 4.1.22

Re: Error Pages (401,403,404) not served for cms folder

Posted: Wed Mar 04, 2009 9:46 pm
by spetracco
Another thing to note - it's not the rewrite rule itself. If you go to the regular URL the same error happens. I noted that if I change this in the config file:

Code: Select all

$config['debug'] = false;
to "true", the problem goes away. Of course, you get the debug output. If I look at the source of index.php I see this section:

Code: Select all

// optionally enable output compression (as long as debug mode isn't on)
if( isset($config['output_compression']) && $config['debug'] != true )
  {
    @ob_start('ob_gzhandler');
  }
else
  {
    @ob_start();
  }
I believe that because output_compression is set to false (after all, it IS set), that it's dropping into the code that gzips the output. However, I'm not a PHP coder to speak of, so I'm not sure if that's correct. I tried commenting out the output_compression line in config.php but that didn't help either.

Hopefully this is enough to point someone in the right direction though.

Thanks,
Susan

Re: Error Pages (401,403,404) not served for cms folder

Posted: Fri Mar 06, 2009 5:49 am
by Dr.CSS
So you are making pages in cmsms by going to content > pages to edit/make the pages?...

FYI  /  is not a file ext. as in .html, .php, .htm, .asp, etc. it is the symbol for a folder that is trying to be opened or a page above the one you are on...

Re: Error Pages (401,403,404) not served for cms folder

Posted: Fri Mar 06, 2009 2:57 pm
by spetracco
Mark, yes, that's how I'm creating pages. FWIW, I commented out everything in that block of index.php like this:

Code: Select all

// optionally enable output compression (as long as debug mode isn't on)
// if( isset($config['output_compression']) && $config['debug'] != true )
//   {
//     @ob_start('ob_gzhandler');
//   }
// else
//   {
    @ob_start();
//   }

Now it works fine, and I get the correct 404 page. Apparently the clause:

Code: Select all

isset($config['output_compression'])
Is evaluating to true, even though the output_compression setting in config.php is set to false. Is that a bug? Or an incompatibility with my version of PHP?

Clearly my server doesn't support sending gzipped output.