Expand my Community achievements bar.

sling:internalRedirect is rewirtting the internal url but truncating the url from #.

Avatar

Former Community Member

If a url is like  -  content/test/en_us/hello.html#button in the below specification,

sling:match : mypage/

sling:internalRedirect : content/test/en_us/

After url rewritting it is creating above url like : mypage/hello.html , here it removes # value from the url.

expected to bo : mypage/hello.html#button

Can any one please help me out here why it is happening like this???

11 Replies

Avatar

Level 7

Try using 

sling:match \[^/]+/mypage/ and see if it works.

 

Thanks

Tuhin

Avatar

Former Community Member

Hi Tuhin,

my map structure is :

map -> http -> www.mysite.com ->  mypage

and mypage sling:Mapping node has the below property

sling:match : mypage/

sling:internalRedirect : content/test/en_us/

on doing so it rewrite the url from : /content/test/en_us/hello.html#button  to : www.mysite.com/mypage/hello.html

here I expect #value to be there in the url.

I have changed sling:match as your advice.

sling:match : \[^/]+/mypage/

Now it is not rewirtting my url it is keeping as it is like : /content/test/en_us/hello.html#button

expected to be www.mysite.com/mypage/hello.html#button.

Can you please help me if I am doing something wrong here or how can we fix this issue?

Thanks,

Avatar

Level 7

Hi,

After this said change could you please try hitting "www.mysite.com/mypage/hello.html#button" and see if this works or not?

Thanks

Tuhin

Avatar

Former Community Member

Hi Tuhin,

I am pointing to url rewritting in content responce. like below.

<a href="https://forums.adobe.com/content/test/en_us/hello.html#button">LEARN MORE</a> this was

rewritten to <a href="http://www.mysite.com/mypage/hello.html">LEARN MORE</a>

I am expecting this like : <a href="http://www.mysite.com/mypage/hello.html#button">LEARN MORE</a>

After the changes you mentioned it is not rewritting the href in responce.

It is same : <a href="https://forums.adobe.com/content/test/en_us/hello.html#button">LEARN MORE</a>

Thanks,

Avatar

Former Community Member

Hi Tuhin,

Actually this map configuration it was working fine earlier, I don't know may be some setting or property changes it is creating this issue.

Can you please help me what changes may can create this issue.

Thanks,

Avatar

Level 7

Kindly Share me your config @ tuhinghosh2610@gmail.com so that I can take a look.

 

Thanks

Tuhin

Avatar

Former Community Member

If anyone can help here with this log. It is clear from log AEM LinkCheckerTransformer is not functioning correctly even if all configuration are same.

In my local :

 com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformer href attribute rewritten from /content/test/en_us/platforms/connect.html#testPage to http://local.myweb.com/platforms/connect.html#testPage

In dev :

com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformer href attribute rewritten from /content/test/en_us/ideas/educator/future-education.html#mypage to http://dev.myweb.com/highered/ideas/educator/future-education.html

 

Thanks in advance if any AEM support team can find this AEM functionality issue.

Avatar

Former Community Member

Yeah I have compared it is exactly the same configuration as in atttached image.