2015-11-11 47 views
1

我無法獲取AEM的分派器模塊上的重寫工作。 以下是做什麼用我的配置發生了:帶重寫規則的AEM分派器虛擬主機設置不起作用

Dispatcher配置:

我的httpd.conf的片段現在

LoadModule dispatcher_module modules/mod_dispatcher.so 

    <IfModule disp_apache2.c> 
     DispatcherConfig conf/dispatcher.any 
     DispatcherLog logs/dispatcher.log 
     DispatcherLogLevel 3 
     DispatcherNoServerHeader 0 
     DispatcherDeclineRoot 0 
     DispatcherUseProcessedURL 0 
     DispatcherPassError 0 
    </IfModule> 


    <VirtualHost *:80> 
     ServerName mobile.example.com.au 
     DocumentRoot "/var/www/html/content/mobile" 
     RewriteEngine on 
     RewriteRule ^/(.*)\.html$ /content/mobile/$1.html [PT] 
    <Directory "/var/www/html/content/mobile"> 
     <IfModule disp_apache2.c> 
     SetHandler dispatcher-handler 
     ModMimeUsePathInfo On 
    </IfModule> 
     Options FollowSymLinks 
     AllowOverride None 
    # AddType text/html .html 
    # AddOutputFilter INCLUDES .html 
    # Options +Includes 
    </Directory> 

    </VirtualHost> 

    ...... 

,如果我嘗試訪問mobile.example.com.au /home.html,它顯示了這個404,並說沒有內容:

未找到

請求的URL /content/mobile/home.html在此服務器上找不到 。

雖然我能夠直接使用的完整路徑命中頁: http://mobile.example.com.au/content/mobile/home.html和頁面呈現。

缺少什麼我在這裏?這與文檔根目錄有關嗎?

此外,我們如何設置mobile.example.com.au的默認登錄頁面以顯示home.html。

回答

1

您能否檢查重寫日誌以查看請求是如何流動的? 此外,設置默認的登錄頁面,你可以用下面的規則

RewriteRule ^/$ /content/mobile/home.html [PT,L] 
+0

另外,請檢查您是否已經在的httpd的conf啓用重寫模塊:) –

0

我相信你需要改變這一行:

DispatcherUseProcessedURL 0

DispatcherUseProcessedURL 1

。 ..以便分派器使用重寫的URL進行篩選檢查,緩存結構和請求t AEM。您還需要按照Mohit的建議添加RewriteRule,可能是第一條規則 - 但僅限於/要顯示/home.html頁面。

參見:Adobe documentation on Dispatcher configuration