Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Aem 是否可以获取重定向后使用的虚荣URL的引用?_Aem_Urlrequest_Vanity Url - Fatal编程技术网

Aem 是否可以获取重定向后使用的虚荣URL的引用?

Aem 是否可以获取重定向后使用的虚荣URL的引用?,aem,urlrequest,vanity-url,Aem,Urlrequest,Vanity Url,我有一页http://localhost:4502/content/project/en/mypage.html 它有两个虚荣的URL设置为 /content/project/vanity-1 /content/project/vanity-2 因此,来自上述两个URL的任何请求都将被重定向到/mypage.html 是否可以从页面重定向到的位置获取虚荣URL请求?i、 我如何才能找到请求来自哪个URL request.getRequestURL为我提供../mypage.html,但我需要获

我有一页http://localhost:4502/content/project/en/mypage.html 它有两个虚荣的URL设置为

/content/project/vanity-1
/content/project/vanity-2
因此,来自上述两个URL的任何请求都将被重定向到/mypage.html

是否可以从页面重定向到的位置获取虚荣URL请求?i、 我如何才能找到请求来自哪个URL


request.getRequestURL为我提供../mypage.html,但我需要获取虚荣URL请求

您应该尝试从/content/project/page/jcr:content-properties-sling:vanityPath获取它

它在HTTP-referer头中可用。您可以通过以下方式获得:

String referrer = request.getHeader("referer");