Expand my Community achievements bar.

SOLVED

Creating multidomain CQ mapping

Avatar

Former Community Member

Hi,

I am using CQ 5.6.1 and trying to create multi-domain CQ mappings for our website and I have already went through the following URLs:

http://www.cognifide.com/blogs/cq/multidomain-cq-mappings-and-apache-configuration/

http://www.wemblog.com/2013/03/how-to-manage-multi-site-using.html

http://helpx.adobe.com/cq/kb/HowToMapDomains.html
 

but not able to do so. My folder exists as /content/mercer and has further language folders like en, fr etc. I have attached the etc.mapping package. Also, this is the following virtual host entry I have done in httpd.conf:

<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName www.mercer.com DocumentRoot "C:\Apache2.2\htdocs" <Directory "C:\Apache2.2\htdocs"> Options FollowSymLinks AllowOverride None </Directory> RewriteEngine On RewriteRule ^/$ /content/mercer/en.html [PT,L] RewriteCond %{REQUEST_URI} !^/apps 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/mercer/en/$1 [PT,L] <IfModule disp_apache2.c> SetHandler dispatcher-handler </IfModule> </VirtualHost>

But all I am getting is the error in error.png file.

Please let me know if there is any other information I need to provide.

Thanks in advance

Ankit

1 Accepted Solution

Avatar

Correct answer by
Level 7

This is how it could be done:

On the dispatcher server, in the vhost you'll have to have this:

//........... in the VHOST file RewriteRule ^/$ /content/mysite/en/start.html [PT,L] RewriteCond %{REQUEST_URI} !^/apps 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/mysite/en/$1 [PT,L] //.....

And on the publisher server (under the map.publish node) the following should be set up:
 

*node* myserver.mysite_com (sling:Mapping) [property] sling:internalRedirect = /content/mysite/en/start.html [property] sling:match = myserver.mysite.com/$ *node* myserver.mysite.com (sling:Mapping) [property] sling:internalRedirect: /content/mysite/en *subnode* redirect (sling:Mapping) [property] sling:internalRedirect = /content/mysite/en/$1, /$1 [property] sling:match = (.+)$

Hope that will solve your problems :)
/johan

View solution in original post

9 Replies

Avatar

Level 10

I see that you read some community articles on this subject. Did you read the AEM topics here:

https://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_domains.html

Avatar

Level 8

The following is copied from http://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_domains.html#The%20Web%20Server%20Re..., describing the needed configs in the dispatcher.any file:

  • The /virtualhosts property must include the ServerName values for the all VirtualHost definitions.
  • The /statfileslevel property must be high enough to create .stat files in the directories that contain the content files for each domain.

See the doc page for an example

scott

Avatar

Level 8

I don't see any attachments to you post, however the question I would have is what approach have you decided to take. Looking at you httpd.conf file it looks to me like you are handing the incoming rewrites at the Apache layer. You said you will have multiple language directories, is you plan to have a different host name for each language (www.mercer.com for English and www.mercer.fr for French) and different virtual hosts for each server name. If so them I am not sure why you need entries in /etc/map. You could handle the outgoing mappings in the JCR Resource Resolver configuration and save yourself the trouble. 

Avatar

Former Community Member

It's not letting me attach the zip package file. However, let me iterate the requirement. So, inside the /content/mercer folder we have multiple language folders like en, fr, de etc. What I am looking for is, to map insights.mercer.com/en to content/mercer/en and insights.mercer.com/fr to content/mercer/fr and so on. How do I achieve this ?

Thanks,

Ankit

Avatar

Level 10

upload at [1] & then share the link you received in email

[1]   https://sendnow.acrobat.com/SignIn.html

Avatar

Level 10

I can see only one mapping. What about rest ?  What is the exact error you are getting? Is the request reaching CQ? 

Avatar

Former Community Member

Yes Sham the requirement is that I am trying to map www.mercer.com to /content/mercer/en. Once this is confirmed I will create rest of the mappings. Let me know if this is ok.

Avatar

Correct answer by
Level 7

This is how it could be done:

On the dispatcher server, in the vhost you'll have to have this:

//........... in the VHOST file RewriteRule ^/$ /content/mysite/en/start.html [PT,L] RewriteCond %{REQUEST_URI} !^/apps 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/mysite/en/$1 [PT,L] //.....

And on the publisher server (under the map.publish node) the following should be set up:
 

*node* myserver.mysite_com (sling:Mapping) [property] sling:internalRedirect = /content/mysite/en/start.html [property] sling:match = myserver.mysite.com/$ *node* myserver.mysite.com (sling:Mapping) [property] sling:internalRedirect: /content/mysite/en *subnode* redirect (sling:Mapping) [property] sling:internalRedirect = /content/mysite/en/$1, /$1 [property] sling:match = (.+)$

Hope that will solve your problems :)
/johan