Expand my Community achievements bar.

SOLVED

how to set the website URL to hit he home page in Cloud AEM

Avatar

Level 9

in AEM we have a home page, e.g. 

/content/site1/en/home.html

we can access this by entering www.oursite.com/content/site1/en/home.html

But if a user hits www.oursite.com they get a blank page.

I am guessing we need to setup some sort of redirect in dispatcher, but didnt find any tutorials for this.  There were different instructions for IIS and apache, but as its cloud, we dont know which if these are being used.

Any suggestions?

We know about apache configuration, so are comfortable with virtual hosts etc, but have no idea about farms.

NOTE: this is for non prod for now.

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @TB3dock 

 

You need to apply a redirect in your dispatcher. Please add the below rule.

 

RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /content/site1/en/home.html [PT,L]

Thanks! 

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi @TB3dock 

 

You need to apply a redirect in your dispatcher. Please add the below rule.

 

RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /content/site1/en/home.html [PT,L]

Thanks! 

Avatar

Level 9
this is helpful, thanks. I see in the displatcher.cloud dir, are various subdirs, including conf.d and conf.dispatcher.d, enabled_vhosts, rewrites, virtualhosts, filters, etc. Any suggestions as to the best one to add this?

Avatar

Level 9
Interestingly, in apache when using a virtual host, you can set document root so the user doesnt see the horrible url. is this possible?

Avatar

Employee
Make sure you set a canonical tag on your homepage having it point to the canonical URL for this page, else you will have 2 URLs for your homepage competing against one another for SEO (aka Google will be less sure as to which it should point to)

Avatar

Community Advisor
You must have a rewrite file for your vhost which will be located under rewrites folder. You can add it there and it should take care of it.