[ 
https://issues.apache.org/jira/browse/SLING-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781828#action_12781828
 ] 

Róbert Csákány commented on SLING-1198:
---------------------------------------

No, I've tested. I need a functionality where the URL dynamic, and the redirect 
path also. In the original mapping the URL dynamic (matchin with regexp), but 
the redirect is static  - so I have to create redirect mapping for all 
subdomain where the path mapping is different - you can redirect all of 
subdomains to one path in the original code. It's fact you can mapping the path 
in subdomains to other pathes, but it's static also - only matching code there, 
not replace. In my solution redirect all subdomains, but it's getting the 
subdomain and dynamically redirect to a path and vica versa.

For example:

Original code

match: (\w+)\.\domain.com\.80
redirectInternal:  /home/domain1
----- cgi-bin -> /scripts
----- images -> /static/images

when a request URL is;     
www.domain.com/cgi-bin -> it's redirected to /cgi-bin
something.domain.com/ -> it's redirected to /home/domain1

So the path is static.

In my solution:

match: @par(1,\w+)@.domain.com\.80
redirectInternal: /home/domain1/@par(1,\w+)@

when a request URL is;     
www.domain.com/cgi-bin -> it's redirected to /home/domain1/www
something.domain.com/ -> it's redirected to /home/domain1/something

I will chek my code again, because maybe the childs that no have parameter 
block (for example some static mapping under dynamic  map) in the Mapping are 
not handled correctly (I check all of the mapping all parameter is presented or 
not, but I think this check is not neccessary in all cases).

I hope I'm understandable.


> Allow mapping nodes to internet domains with template parameters
> ----------------------------------------------------------------
>
>                 Key: SLING-1198
>                 URL: https://issues.apache.org/jira/browse/SLING-1198
>             Project: Sling
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: JCR Resource 2.0.2
>            Reporter: Róbert Csákány
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.4
>
>         Attachments: MapEntry.patch
>
>
> Sling should support hosting multiple domains, with different JCR roots.
> E.g.:
> http://www.domain1.com could map to /content/domain1.com
> http://www.domain2.com could map to /content/domain2.com
> While developing a website, the fully qualified domain might not be 
> available. Ideally, the mapping could be configured in a flexible way. One 
> option would be to maintain a set of regular expressions to match against 
> URLs. Each regexp would then match to a path in the JCR.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to