2015-09-05 30 views
1

我改變了基於Plone的4重定向301上的Plone CMS

我讀了所有關於重定向對計算器的Plone CMS問題301,但我想用盡可能簡單的方法來做到這一點像修改我的虛擬主機和URL的一個十年插入線

Redirect 301 old-url new-url 
Redirect 301 old-url new-url 

,但我不知道在哪裏插入我的虛擬主機此行

我嘗試不同的地方,但似乎不工作

我的虛擬主機:

<VirtualHost *:80> 
    ServerName example.com 
    ServerAlias www.example.com 
    ServerSignature On 

    CustomLog  /home/log/example.com-access.log combined 
    ErrorLog  /home/log/example.com-error.log 
    LogLevel warn 

    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteRule ^/icons/ - [L] 

    RewriteRule ^/(.*) \ 
     http://localhost:8082/VirtualHostBase/http/%{SERVER_NAME}:80/example/VirtualHostRoot/$1 [L,P] 
</IfModule> 

    <IfModule mod_proxy.c> 
    ProxyVia On 

    <LocationMatch "^[^/]"> 
     Deny from all 
    </LocationMatch> 
    </IfModule> 

<Proxy *> 
    Order deny,allow 
    Allow from all 
</Proxy> 

    <IfModule mod_disk_cache.c> 
    #CacheEnable disk/
    </IfModule> 

    <IfModule mod_deflate.c> 
    </IfModule> 
</VirtualHost> 

的想法是把:

Redirect permanent http://www.example.com/old-url-xxx http://www.example.com/new-url-xxx 
Redirect permanent http://www.example.com/old-url http://www.example.com/new-url 
+0

向我們展示您嘗試過的。除非我們能夠看到您當前主機規則的結構,否則這是一種猜測遊戲。 – SteveM

+0

我用我的虛擬主機編輯 – bklups

回答

4

立即現有重寫規則上面,添加如下規則:

RewriteRule ^/old-url(.*) http://www.example.com/new-url$1 [L,R=301] 

這重定向一整節通過將/old-url/(如果有)之後的路徑部分匹配並將其放在重定向URL的末尾來匹配URL。