[opencms-dev] handle404 appears on every 404 page within the export folder
Mario Jäger
m.jaeger at alkacon.com
Thu Aug 26 09:36:58 CEST 2010
Hi Graeme,
It seems, that you use Apache with mod_jk.
Please, have a look here to check your configuration: http://www.opencms-wiki.org/MultiSite_configuration_instructions_%28apache_%2B_mod_jk%29
I think one point is, that you should use the following line in the Apache configuration, if your OpenCms installation is installed as the ROOT application in Tomcat:
RewriteRule .* http://127.0.0.1:8081/opencms/handle404?exporturi=%{REQUEST_URI}&%{QUERY_STRING} [P]
instead of that line:
RewriteRule .* http://127.0.0.1:8081/handle404?exporturi=%{REQUEST_URI}&%{QUERY_STRING} [P]
--
Kind Regards,
Mario.
-------------------
Mario Jäger
Alkacon Software GmbH - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org
Graeme Kidd schrieb:
> Hi,
>
> I am using the "CmsOnDemandStaticExportHandler" Static Export Handler which requires the following mod_rewrite configuration:
> RewriteCond %{REQUEST_URI} ^/export/(.*) [NC]
> RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}" !-f
> RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}/index_export.html" !-f
> RewriteRule .* http://127.0.0.1:8081/handle404?exporturi=%{REQUEST_URI}&%{QUERY_STRING} [P]
>
> This all works fine when the resource doesn’t exist but is still to be exported, what I find annoying however is when the file really doesn't exist. As it causes the 404 page to say this within the export directory:
> "The requested resource "/handle404" was not found on the server."
>
> So for example you could have:
> http://www.test.com/export/doesnotexist.gif
>
> Then instead of saying:
> The requested resource "/export/doesnotexist.gif" was not found on the server.
>
> It says:
> The requested resource "/handle404" was not found on the server.
>
> I have tried changing the line to "request.getRequestURL()" and "request.getServletPath()" but they both return a path that includes handle404.
>
> The only way round this I can think of would be to use JavaScript in the handle404.jsp page e.g.
> "document.location.href"
>
> If that is the best solution then might I suggest that a future improvement would be to detect if the file really doesn’t exist and return the URI to its original location.
>
> Thanks,
> Graeme
>
>
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
More information about the opencms-dev
mailing list