Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Vanity url is not working with rewrite rule

Avatar

Avatar
Validate 1
Level 3
Anderson_Hamer
Level 3

Likes

13 likes

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Anderson_Hamer
Level 3

Likes

13 likes

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Anderson_Hamer
Level 3

21-08-2020

We are trying to make the vanity url works on both publish and dispatcher servers.  Download and installed the VanityURLS-Components package and followed all the steps that documented.

 

The vanity url is working only when we delete or comment the below rewrite rule

  RewriteCond %{REQUEST_URI} !^/apps

  RewriteCond %{REQUEST_URI} !^/bin

  RewriteCond %{REQUEST_URI} !^/content

  RewriteCond %{REQUEST_URI} !^/etc

  RewriteCond %{REQUEST_URI} !^/home

  RewriteCond %{REQUEST_URI} !^/libs

  RewriteCond %{REQUEST_URI} !^/tmp

  RewriteCond %{REQUEST_URI} !^/var

  #RewriteRule ^/(.*)$ /content/myproject/$1 [PT,L]

 

But the above commented rewrite rule is required to allow only /content path. Dispatcher filter will reject any request that is not started with /content. With that even etc sling mapping also could not help because the request is not blocked at dispatcher level and not reached publish server.

Is there any other way to handle this without removing rewrite rule?

Replies

Avatar

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

105 likes

Total Posts

118 posts

Correct Reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

105 likes

Total Posts

118 posts

Correct Reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Albin_Issac
MVP

21-08-2020

One option I can think of is always enable the vanity URL in AEM by appending the full content URL(append the hided path) .e.g append /content/myproject(/content/myproject/vainity1) to enable the vanity path /vanity1(https://www.example.com/vanity1). The [PT] rule defined by you in the Apache always append /content/myproject for your vanity URL's (/content/myproject/vanity) so the AEM server match the right vanity defined(/content/myproject/vanity1)

If you follow this option, the VanityURLS-Components configurations are not required - these configurations are enabled only to whitelist the vanity paths in the farm filter.

Regards

Albin I

www.albinsblog.com

Avatar

Avatar
Give Back
Level 2
narendragandhi
Level 2

Likes

17 likes

Total Posts

14 posts

Correct Reply

6 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Give Back
Level 2
narendragandhi
Level 2

Likes

17 likes

Total Posts

14 posts

Correct Reply

6 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 10
Boost 1
View profile
narendragandhi
Level 2

21-08-2020

Hi @Anderson_Hamer ,

 

You could use the /vanity_urls filter to enable the auto filtering for all vanity URLs. Here is the article you could refer to configure this - https://helpx.adobe.com/experience-manager/kb/ams-dispatcher-manual/disp-vanity-url.html

 

 

Avatar

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

130 likes

Total Posts

233 posts

Correct Reply

38 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

130 likes

Total Posts

233 posts

Correct Reply

38 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Singaiah_Chintalapudi
MVP

21-08-2020

 

First of all, the above snippet is used to append the /content/myproject/* path to your incoming shortened urls. Ex: www.example.com/mypage.html would resolve to: server:port/content/myproject/en/mypage.html. The highlighted part would vary based on project implementation. All other urls would go publish server unless you're blocking them at dispatcher filters.

 

You can use RewriteRule to redirect your vanity to AEM URLs. 

 

Whats your exact specific use case? You don't need the vanity urls package.

Avatar

Avatar
Validate 1
Level 3
Anderson_Hamer
Level 3

Likes

13 likes

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Anderson_Hamer
Level 3

Likes

13 likes

Total Posts

34 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Anderson_Hamer
Level 3

24-08-2020

Yeah but this /vanity_urls filter is not the filtering the vanity URLs that get stored in /temp/vanity_urls file. I could see the vanityURLS in {dispurl}/libs/granite/dispatcher/content/vanityUrls.html

 

What happens here is, if I hit the vanity URL like - {dispURL}/vanity1, then rewrite rule comes into picture and it is adding /content/myproject/vanity1 and sending a request to publisher, getting 404 page as there is no such page in pub server.

 

The dispatcher would want to send the same request as vanity like {dispaURL}/vanity1 to pub server then the pub will resolve the url resource and it will server the request. Is there any other way to do this ?

Avatar

Avatar
Give Back
Level 1
ssks_aem
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
ssks_aem
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
ssks_aem
Level 1

25-08-2020

Hi @Anderson_Hamer ,

 

I have a similar kind of issue.Is the above issue resolved?

 

Avatar

Avatar
Give Back
Level 1
abhinav_kumars1
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Give Back
View profile

Avatar
Give Back
Level 1
abhinav_kumars1
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Give Back
View profile
abhinav_kumars1
Level 1

12-01-2021

Hi is this issue resolved ?