[opencms-dev] Help required for URL rewriting in OpenCms

Raghu D Raghu.Devaraj at ibsplc.com
Fri Jun 17 06:48:14 CEST 2011

Hi All,

        We have a requirement that user selected  country and language 
should be appended to the url. For eg the url 
http://www.domain.com/cms/airports/airportlounges.html  should be shown as 
http://www.domain.com/cms/in/en/airports/airportlounges.html . For this 
purpose i m using the tuckey URL rewrite filter and rewriting the url.The 
OpenCmsServlet url pattern is "/cms/*" and hence the url posted to cms 
will be /in/en/airports/airportlounges.html . Since the path "/in/en" is 
not physically exist in the cms, the CmsObject.
getRequestContext().getSiteRoot() is null and the 
cms.getRequestContext().getUri()looks like /sites/default/
in/en/airports/airportlounges.html . 
        To correct this, i m removing the "/in/en/" from the uri and 
setting it back to the cms.getRequestContext().setUri(uri) and also 
setting thecms.getRequestContext().setSiteRoot("/sites/default"). However 
the CmsResource resource.getRootPath()is null and the resources related to 
the uri are not read using cms.readPath(tempUri, CmsResourceFilter.ALL); . 
This is resulting in page not found exception.
        Can anyone please advise me ,how is the CmsResource parameters are 
set for a request and also is it possible to modify the CmsResource 
parameters ?

Thanks and Regards,

Raghu D | Senior Software Engineer 

IBS Software Services (P) Ltd
5th floor NILA , Technopark Campus, Trivandrum
Mob: +91-9037358606
Raghu.Devaraj at ibsplc.com | www.ibsplc.com


"The information in this e-mail and any attachment is intended only for 
the person to whom it is addressed and may contain confidential and/or 
privileged material. If you have received this e-mail in error, kindly 
contact the sender and destroy all copies of the original communication. 
IBS makes no warranty, express or implied, nor guarantees the accuracy, 
adequacy or completeness of the information contained in this email or any 
attachment and is not liable for any errors, defects, omissions, viruses 
or for resultant loss or damage, if any, direct or indirect."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110617/cc55815c/attachment.htm>

More information about the opencms-dev mailing list