Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Is there a way to change the URL name without moving the page

Avatar

Level 1

Unfortunately, I've made pages with capital letters in the URL and I want to change them. As the question asks there a way to change the URL name without moving the page?

 

Or is there a way to change multiple URLs at once?

 

Thank you

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,


Using vanity url we can request page using different url. Vanity ur l is present under Page properties --> Basic Tab. We can also write custom script or use groovy script to add vanity url property to jcr:content automatically to multiple pages by reading the existing path and converting to small letters. 

 

Screen Shot 2020-08-16 at 5.36.17 PM.png

 

https://helpx.adobe.com/experience-manager/kb/ams-dispatcher-manual/disp-vanity-url.html

 

 

View solution in original post

15 Replies

Avatar

Correct answer by
Community Advisor

Hi,


Using vanity url we can request page using different url. Vanity ur l is present under Page properties --> Basic Tab. We can also write custom script or use groovy script to add vanity url property to jcr:content automatically to multiple pages by reading the existing path and converting to small letters. 

 

Screen Shot 2020-08-16 at 5.36.17 PM.png

 

https://helpx.adobe.com/experience-manager/kb/ams-dispatcher-manual/disp-vanity-url.html

 

 

Avatar

Community Advisor

You have 4 options

 

1) update the rewrite rules in the dispatcher

2) vanity url (available in the page properities)

3) Sling alias (available in the page properities)

4) Akamai (if you are looking to implement as 302 or 301) .  This option is only available if CDN is part of your topology , if not available do ignore this option.

Avatar

Employee

Hello @TTayler,

You can explore the Alias feature in AEM to satisfy your use-case. For instance, if you have a page /content/we-retail/TEST.html to be changed to /content/we-retail/test.html, you can follow below steps to achieve the same.

 

Steps:

1) Go to /editor.html/content/we-retail/TEST.html

2) Open Page properties and go to Advanced Tab

3) Declare an Alias for this page by giving it an value of "test".

Now you'll be able to hit the page /content/we-retail/TEST.html as well as /content/we-retail/test.html.

 

You can check further on this in documentation SEO and URL Management Best Practices https://helpx.adobe.com/experience-manager/6-3/managing/using/seo-and-url-management.html

 

Other way is described here in https://www.bc.edu/offices/its/projects/day/docs/renaming-page.html#:~:text=Click%20the%20MOVE%20men...

 

https://as.nyu.edu/communications/aem-faq/change-url-page.html

 

Thanks!!

 

 

Avatar

Level 3

Hi @vanegi , 
If I add sling:alias for pages in each language copy, sling:alias works and I can access the page using alternative name but when I access page directly or through navigation, it picks original names only (page node names) unless I manually replace it will sling:alias value in url. 
Could you please let me know how can I get sling:alias value in url whenever I access any page?
Thanks in advance.



Avatar

Community Advisor

Hi,

If you will not use move feature then the reference page links will be unchanged and end user still accessing page using old URL(capital).

There are various options are already shared -

1. Using sling alias --> It will allow you to access page using alternative page name. References of this page will be unchanged.

You may need to write rewrite rules at Apache to forward request to new page name url, if end user is accessing pafe with old url.

2. Don't use vanity path, it is more complex than it looks and in your case it is not required.



Arun Patidar

Avatar

Level 3

Hi @arunpatidar Could you please suggest best way to translate urls?
I've created multiple language copies from English source copy, hence all the page node name are in english which makes urls like /content/home/shop/finance etc. All markets would expect urls to be in localised language. If I add sling:alias for pages in each language copy, sling:alias works and I can access the page using alternative name but when I access page directly or through navigation, it picks original names only (page node names) unless I manually replace it will sling:alias value in url. 
How can I get sling:alias value in url whenever I access any page?

Thanks in advance.

Avatar

Community Advisor

Hi,

You can use the sling:alias for this use case but you have to update the navigation and link component to construct the path using alias if exists.



Arun Patidar

Avatar

Level 3

@arunpatidar would AEM pick sling:alias value when page is accessed from sites console or crx? For me when I access any page, it opens up with url as the original nodes name and not with sling:alias. However in my scenario, I want the page urls to have the sling:alias value whenever a page is accessed.

Avatar

Community Advisor

No, in crxde and sites console, you will see the page with the original name. 

Sling:alias you can use for generating end user urls in publish run mode.



Arun Patidar

Avatar

Level 3

@arunpatidar Thanks for your response. 
I'm unable to make sling:alias work. I didn't expect the node name of pages in crx/site console to be changed. However what I'm expecting is for e.g http://localhost:4502/content/home to be opened in url as http://localhost:4502/content/home-new where 'home-new' is alias of 'home' without me having to manually change in url. 
My scenario is to have all the pages which are with english node names under Spanish language copy to be directly accessed with translated urls (using sling:alias) when an end user will access the page. Page will be accessible if I manually replace 'home' in url with 'home-new' but I'm looking for page 'home' to be opened with urls as default with '.../home-new'.
Is there anything else that needs to be done, could you please help here? 

Avatar

Community Advisor

In this case you need to use vanity urls.



Arun Patidar

Avatar

Level 3

Hi @arunpatidar , 
If an author wants a page to be accessible from a second location for promotional purposes or complete different url, AEM’s vanity URLs might be useful. Is it not at all achievable to have sling:alias in use for my scenario?
Rather than having a Spanish-speaking user navigate to:
www.mydomain.com/es/home.html
I expect the url to be :

www.mydomain.com/es/casa.html

Where 'home' has alias value as 'casa' and this doesn't work. I tried it on we-retail website as well. 

Avatar

Community Advisor

@TTayler 

Never fear when Groovy scripts are here!! 

Try running groovy scripts on the AEM project, it's easy to setup and easy to execute. I have implement something similar where I had to update the title of the page.
Let me know if you need any help in creating groovy scripts for the mentioned automation. You can also refer Groovy Scripts on AEM Content   


Happy Coding!! 

Avatar

Level 2

@Nikhil-Kumar - My use case is that the business author can directly change the name of the page without using the MOVE option.Is there any option available?