-
1. Re: Change the URL path for CQ?
orotas Jul 30, 2012 1:29 PM (in response to stewa52)This shows you how to do it using just the JCR Resource Resolver setting http://dev.day.com/content/kb/home/cq5/Development/How%20to%20configure%20link%20rewriting .html.
This is documentation on the more complex /etc/map approach https://cwiki.apache.org/SLING/flexible-resource-resolution.html. This will allow you to apply rules differently based on host name which you can't do with JCR Resource resolver.
You can combine either approach with using Apache mod_rewrite to do the incoming rewrites (which has the approach of ensuring that the content is cached with it's full URL in case you are want to use a single dispatcher to front for multiple web sites).
-
2. Re: Change the URL path for CQ?
stewa52 Aug 17, 2012 1:03 PM (in response to orotas)Using teh JCR resource resolver I can get it so the /content/site/en/ is stripped out, but I still have to go to en.html for the homepage. How can I get the homepage to act like a index.html file?
-
3. Re: Change the URL path for CQ?
stewa52 Aug 17, 2012 2:01 PM (in response to stewa52)Also, once you change it so CQ is mapping the URL to pull out the /content/site/en, how do you configure the dispatcher?
-
4. Re: Change the URL path for CQ?
Rajesh.wdc Aug 17, 2012 4:46 PM (in response to stewa52)Easiest way would be to put a '/' in the "Vanity URL" field of "basic" tab on "page properties" of your home page
You can configure a list of such varity URL's for each of your pages
like
www.geometrixx.com can be made to show en.html
www.geometrixx.com/en can also be made to show en.html and so on.
-
5. Re: Change the URL path for CQ?
orotas Aug 17, 2012 6:09 PM (in response to Rajesh.wdc)The problem with use a vanity URL for this and striping it out in the resource resolver is that the request won't get cached by dispatcher (and it's probably one of you most highly trafficed sites so you want it to get cached by dispatcher.
I have found that it's best to use your web server tier for this kind of mapping. If you are using Apache you can set up mod_rewrite to do a rewrite of / to /en.html and the change will be transparent to the end user, but dispatcher will think the request is for en.html and will cache the page appropriately. If you just pass / to dispatcher it won't cache the response.
-
6. Re: Change the URL path for CQ?
stewa52 Aug 20, 2012 11:48 AM (in response to orotas)If you have two sites, a mobile and desktop, how could you setup so that
the /content//en does not show up? If I change the
mapping on the resource resolver then the mobile site links will just
resolve to the desktop site.
-
7. Re: Change the URL path for CQ?
orotas Aug 20, 2012 11:54 AM (in response to stewa52)How do you currently distingush between your desktop site and your mobile site? Is it based on host name?
If you have two different sites that are distingushed by host name you can't solve that problem with the JCR Resource resolver. You have two choices:
- Use Apache mod_rewrite to do the rewrites at the Apache layer. With mod_rewrite you can use the host name as part of your rule definition and map the host names to the correct paths.
- Use the /etc/map approach to configuring the resource resolver - you can see that documentation at https://cwiki.apache.org/SLING/flexible-resource-resolution.html- this will allow you to configure different resource resolution based on request data.
Paul McMahon
-
8. Re: Change the URL path for CQ?
stewa52 Aug 23, 2012 3:26 PM (in response to orotas)Using /etc/map, I can replace the incoming requests to insert a /content/<sitename>/en, but what about the URLs that are rendered in the html? Those URLs will still have the /content/<sitename>/en. Do I still have to use the JCR Resource Rsolver to truncate the URLs rendered in the HTML?
-
9. Re: Change the URL path for CQ?
Yogesh Upadhyay Aug 23, 2012 8:41 PM (in response to stewa52)Links on page also get resolve using /etc/map entry (Unless link rewriter is disabled or those links in overriding pattern of Link checker confguration). You don't have to do any special configuration.
Yogesh
-
10. Re: Change the URL path for CQ?
Tomalec W Oct 8, 2012 3:55 PM (in response to Yogesh Upadhyay)I set up /etc/map correctly (as far as I can read from /system/console/jcrresolver
Mapping Map Entries shows:^/content/myapp/en/ http://localhost:8502/en-us/ external: 302
Link Checker Transformer is enabled, but still I get<a href="/content/myapp/en/page.html">link</a>
So if there is no special configration needed, what am I doing wrong?
-
11. Re: Change the URL path for CQ?
C F 9 Nov 7, 2012 11:37 AM (in response to Tomalec W)Hi - Did you solve this issue? and if so how please?
I have the same issue with URL mapping set for example: /content/xyzzy/en_us:/en_us and maps fine on way in but doesn't work on way out.
Also the only other issue is the package manger link on the main page doesn't link and I wondered if this was a link that was supposed to be rewritten on the way out but was not.
Thank you very much,
C
-
12. Re: Change the URL path for CQ?
Chandra gupta Jul 28, 2013 9:22 AM (in response to C F 9)I am able to shorten URL in combination with apache and /etc/map/http CQ... and it works very well with http schema (non-secure). But same shortened URL not working with https (secure) ... Now you may ask https is configured on apache and CQ....so to reply on this... yes...it's configured and in fact complete URL works with https.
any speacial treatment for https to work???... in fact shortned URL does not work on CQ level itself. my sling mtach is like this "qa.abc.com/abc" and internalredirect is like this /content/abc/en.html.
entry is made in /etc/map/http/localhost_any.
Please share your thoughts.
Thanks Chandra
-
13. Re: Change the URL path for CQ?
Rajesh.wdc Jul 28, 2013 10:52 AM (in response to Chandra gupta)Hi Chandra,
You would have created redirections under /etc/map/http. You will also
have to create same redirections under /etc/map/https too.
Regards
Rajesh
-
14. Re: Change the URL path for CQ?
Chandra gupta Jul 28, 2013 12:26 PM (in response to Rajesh.wdc)Hey Rajesh,
Thamks, It works, unfortunately, its not mentioned anywhere in adobewiki/ doc.
Thanks Chandra
-
15. Re: Change the URL path for CQ?
Chandra gupta Jul 28, 2013 12:36 PM (in response to Chandra gupta)I am glad about dispatcher caching as well ...cache folder got created under IHS cache directory in shortened URL manner and i thought this is different than actul crx strcuture and cache would not be flushed but i was proved wrong and flush works


