Trouble setting up Dispatcher with vhost config and sling mappings
https://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_domains.html
Hi,
I am trying to setup my web dispatcher so that users who browse to http://myserver.com will go through the following process
1. client gets routed to http://myserver.com/index.html
2. web server will check dispatcher to see if /var/www/htdocs/content/site/index.html exists. if exists, serve page. if does not exist, go to 3.
3. dispatcher routes to the publish instance and get /content/site/index.html from the repository and serve
The following is my vhost configuration
NameVirtualHost *:80
<VirtualHost *:80>
ServerName web-qa-01
DocumentRoot "/var/www/html/content/site"
RewriteEngine on
RewriteRule ^/$ /content/site/index.html [PT,L]
RewriteRule ^/(.*)$ /content/site/$1 [PT,L]
<Directory /var/www/html/content/site>
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
Options FollowSymLinks
AllowOverride None
</Directory>
</VirtualHost>
I have my dispatcher.any set to use /docroot "/var/www/html/content/site"
On my publish instance, I added the following sling:Mappings
/etc/map/http/web-qa-01
--sling:internalRedirect = /content/site/index.html
--sling:match = web-qa-01/$
When I hit my site with a browser, I see web-qa-01/content/geometrixx-outdoors/en.html. From the apache's access logs, I see that the following event sequence
137.XX.XX.XX - - [01/Jan/2014:15:39:17 -0800] "GET / HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
137.XX.XX.XX - - [01/Jan/2014:15:39:17 -0800] "GET /index.html HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
137.XX.XX.XX - - [01/Jan/2014:15:39:18 -0800] "GET /content.html HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
137.XX.XX.XX - - [01/Jan/2014:15:39:19 -0800] "GET /geohome.html HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
137.XX.XX.XX - - [01/Jan/2014:15:39:19 -0800] "GET /content/geometrixx-outdoors.html HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
137.XX.XX.XX - - [01/Jan/2014:15:39:20 -0800] "GET /content/geometrixx-outdoors/en.html HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
I know it goes to /geohome.html because /content.html has a target to route to /geohome.html. However, shouldn't the sling;Mappings created in the publish instance ignore this? What am I missing?
Thank You.