2009-09-08 96 views
1

我在IIS上運行Joomla。我有大約十幾個類別(金融通訊出版商),我正在使用它來組織大約40篇文章(金融通訊)。我使用的是內置SEO這樣的URL的外觀像這樣的Joomla:301在IIS上與Joomla重定向

http://www.global-autotrading.com/autotraded-newsletters/13-angel-publishing/43-options-trading-pit.html

的數字在類別的前面和文章是煩人,我不是太喜歡所提供的導航Section Layout菜單項。另外,一些金融通訊不是在出版商的保護下運作,所以我想要一個更靈活的組織。

我試着簡單地構建一個菜單層次結構(在autotraded通訊菜單下),有一些通訊直接在父菜單項下,還有一些發佈者將他們的通訊作爲它們下面的菜單項。但是,這導致一些鏈接中斷。點擊一個鏈接會把我帶到錯誤的文章,而不是。因此,似乎使用手動編碼的菜單結構與使用另一個內容的「並行」部分佈局視圖不兼容。

因此,我決定擺脫使用類別來組織該內容的想法。我將爲每個「發佈者」類別創建一篇文章。我會在該發佈商的文章中手動添加指向每個發佈商的新聞快訊的鏈接。我還會創建一個像上面描述的平行菜單結構。

無論如何,這是很多的背景信息,希望我會得到一些確認,我沒有做一些根本性的缺陷。

問題是,有外部網站直接鏈接到上面的一些網址。我不希望這些鏈接中斷(我相信經典的SEO問題)。我認爲該解決方案是使用301重定向到(例如)重新導向從:

http://www.global-autotrading.com/autotraded-newsletters/13-angel-publishing/43-options-trading-pit.html

http://www.global-autotrading.com/autotraded-newsletters/angel-publishing/options-trading-pit.html 

或從

http://www.global-autotrading.com/autotraded-newsletters/4-10-percent-per-month/12-10-percent-per-month.html

http://www.global-autotrading.com/autotraded-newsletters/10-percent-per-month.html 

在IIS中創建301重定向有各種指導(例如:http://www.webconfs.com/how-to-redirect-a-webpage.php),但我想知道這些是否與Joomla兼容,特別是Joomla打開了SEO功能。

而且,如果它看起來像我在做某種根本性錯誤,請讓我知道:)

謝謝!

回答

0

這是web.config文件的重寫部分。最棘手的部分是要弄清楚,重定向規則需要preceed的SEO規則在web.config

<rewrite> 
    <rewriteMaps> 
    <rewriteMap name="StaticRedirects"> 
     <add key="/old-url-1.html" value="new-url-1.html" /> 
     <add key="/old-url-2.html" value="new-url-2.html" /> 
    </rewriteMap> 
    </rewriteMaps> 
    <rules> 
    <rule name="Security Rule" stopProcessing="true"> 
     <match url="^(.*)$" ignoreCase="false" /> 
     <conditions logicalGrouping="MatchAny"> 
     <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" /> 
     <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" /> 
     <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" /> 
     <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" /> 
     <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" /> 
     </conditions> 
     <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> 
    </rule> 
    <rule name="Redirect Rule" stopProcessing="false"> 
     <match url=".*" /> 
     <conditions> 
     <add input="{StaticRedirects:{REQUEST_URI}}" pattern="(.+)" /> 
     </conditions> 
     <action type="Redirect" url="{C:1}" appendQueryString="False" redirectType="Permanent" /> 
    </rule> 
    <rule name="SEO Rule"> 
     <match url="(.*)" ignoreCase="false" /> 
     <conditions logicalGrouping="MatchAll"> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" /> 
     <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" /> 
     <add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" /> 
     <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" /> 
     </conditions> 
     <action type="Rewrite" url="index.php" /> 
    </rule> 
    </rules> 
</rewrite> 
0

代碼與此類似,最近包括在默認安裝的Joomla開始於1.6.2版本。

重要的是所有外部重定向都在內部重寫之前列出,否則重寫的指針將作爲新URL無意中重新顯示在網絡上。