1

我在 IIS 上运行 Joomla。我有大约十几个类别(金融通讯出版商),我用它们来组织大约 40 篇文章(金融通讯)。我正在使用 joomla 内置的 SEO,所以 URL 看起来像这样:

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

类别和文章前面的数字很烦人,我不太喜欢 Section Layout 菜单项提供的导航。此外,一些财经通讯不在出版商的保护下运作,所以我想要一个更灵活的组织。

我尝试简单地构建一个菜单层次结构(在自动交易的时事通讯菜单下),其中有一些时事通讯直接位于父菜单项下,一些出版商的时事通讯作为菜单项位于其下方。但是,这导致一些链接中断;点击一个链接会把我带到错误的文章,什么不是。因此,使用手动编码的菜单结构似乎与使用内容的另一个“并行”部分布局视图不兼容。

因此,我决定放弃使用类别来组织内容的想法。我将为每个“发布者”类别创建一篇文章。我将在该出版商的文章中手动添加指向每个出版商时事通讯的链接。我还将像上面描述的那样创建一个并行菜单结构。

无论如何,这是很多背景信息,希望我能得到一些确认,证明我没有做一些根本上存在缺陷的事情。

问题是有外部站点直接链接到上面的某些 URL。我不希望这些链接中断(我相信经典的 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 兼容,尤其是与启用了 SEO 功能的 Joomla。

另外,如果我似乎做错了什么,请告诉我:)

谢谢!

4

2 回答 2

0

这是有效的 web.config 文件的重写部分。最棘手的部分是找出重定向规则需要先于 web.config 中的 SEO 规则

<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>
于 2009-09-25T00:46:53.673 回答
0

与此类似的代码最近包含在从 1.6.2 版开始的默认 Joomla 安装中。

重要的是在任何内部重写之前列出所有外部重定向,否则重写的指针将在不经意间作为新 URL 暴露在 Web 上。

于 2011-04-15T11:36:01.743 回答