What is the rewrite rule for this case

Splash Forums Rewrite Users What is the rewrite rule for this case

This topic contains 0 replies, has 1 voice, and was last updated by  NamNVH 3 years, 12 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #27783

    NamNVH
    Participant

    Original URL:
    …/searchResult/SearchResultNotFound.xhtml?lang=en&cont=USA&keyword=abc&remainFlg=false&returnFlg=true
    URL after Rewrite:
    …/USA/en/search-not-found/abc?remainFlg=false&returnFlg=true

    There are some constraints:
    1. The reason I want to keep the ?remainFlg=false&returnFlg=true because this part is dynamic.
    Which means sometimes it could be “remainFlg=false&returnFlg=true”, other times it could be “remainFlg=false”, other times it could be “remainFlg=false&returnFlg=true&upFlg=true”, and so on.
    The only part will always be on URL is “lang=en&cont=USA&keyword=abc”.
    For this reason I only want to rewrite the “lang=en&cont=USA&keyword=abc” part.

    2. This must be 2-way mapping. Meaning that whether I type in browser address bar:
    …/searchResult/SearchResultNotFound.xhtml?lang=en&cont=USA&keyword=abc&remainFlg=false&returnFlg=true
    or
    …/USA/en/search-not-found/abc?remainFlg=false&returnFlg=true
    the URL which end-users see must be:
    …/USA/en/search-not-found/abc?remainFlg=false&returnFlg=true

    3. The URL after Rewrite could either be:
    …/USA/en/search-not-found/abc?remainFlg=false&returnFlg=true
    or
    …/USA/en/search-not-found/abc
    Whichever is fine, but in my java code, I have to be able to get the value of all parameters after the question mark (?).
    Eg: FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(“returnFlg”);

    Thank you in advance.

Viewing 1 post (of 1 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.