You need to sign in to do that
Don't have an account?
Abhilash Mishra 13
How to rewrite URL Links that are Generated By Javascripts
Hello,
I need to use URL rewriting for My site.
How ever the rewriter class only rewrites whats written using $page or URLFOR() methods.
Like :
this also works fine:
how ever when it comes to use a simple string to specify URL. It failes poorly.
the above links are generated as a part of javascript output.
Is there any way or work around to make them rewritable too.
Please Help.
I need to use URL rewriting for My site.
How ever the rewriter class only rewrites whats written using $page or URLFOR() methods.
Like :
<apex:outputlink value="{!URLFOR($page.pagename,null,[pageid='asdvsv'])}"> This is rewritabale link</apex:outputlink>
this also works fine:
<a href="{!URLFOR($page.pagename,null,[pageid='asdvsv'])}"> This is rewritabale link</a>
how ever when it comes to use a simple string to specify URL. It failes poorly.
<a href="/pagename?pageid=sdsfv"> This fails in rewriting</a>
the above links are generated as a part of javascript output.
Is there any way or work around to make them rewritable too.
Please Help.
like if your url is
/pagename?pageid='dsdsdsdvsa'
which become SEO friendly as /pagename/mypage.
you need to use /pagename/mypage. directly in dynamic links. other wise you must use
{!URLFOR($page.pagename,null,[pageid='asdvsv'])}" which will convert this to the same URL friendly URL
All Answers
You need to apend '/apex' for the href.
Can you try the below one
Not working !!!
Like here : http://sfecom-developer-edition.ap2.force.com/
the first link uses :
the second
like if your url is
/pagename?pageid='dsdsdsdvsa'
which become SEO friendly as /pagename/mypage.
you need to use /pagename/mypage. directly in dynamic links. other wise you must use
{!URLFOR($page.pagename,null,[pageid='asdvsv'])}" which will convert this to the same URL friendly URL