Creating multidomain CQ mapping | Community
Skip to main content
October 16, 2015
Solved

Creating multidomain CQ mapping

  • October 16, 2015
  • 9 replies
  • 4214 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ojjis

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

9 replies

smacdonald2008
New Participant
October 16, 2015

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

Scott_Brodersen
New Participant
October 16, 2015

The following is copied from http://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_domains.html#The%20Web%20Server%20Rewrites%20Incoming%20URLs, 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

New Participant
October 16, 2015

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. 

October 16, 2015

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

Sham_HC
New Participant
October 16, 2015

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

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

October 16, 2015

Thanks Sham. I have kept the file at https://sendnow.acrobat.com/?i=Ul7zg4ps0coJyUCodjsAYA

Sham_HC
New Participant
October 16, 2015

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

October 16, 2015

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.

Ojjis
OjjisAccepted solution
New Participant
October 16, 2015

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