views:

463

answers:

1

Hello,

I'm running Joomla on IIS. I've got about a dozen categories (financial newsletter publishers) that I'm using to organize about 40 articles (financial newsletters). I'm using the joomla built-in SEO so the URL's look like this:

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

The numbers in front of the categories and articles are annoying, and I'm not too fond of the navigation provided by a Section Layout menu item. Also, some financial newsletters don't operate under the umbrella of a publisher so I want a more flexible organization.

I've tried simply constructing a menu hierarchy (under the autotraded newsletters menu) that has some newsletters directly under the parent menu item, and some publishers with their newsletters as menu items underneath them. However, that was causing some links to break; clicking on a link would take me to the wrong article, and what not. Thus, it seems like using a hand-coded menu structure is not compatible with using another, "parallel" section-layout view of the content.

Thus, I've decided to get rid of the idea of using categories to organize that content. I'm going to create an article for each "publisher" category. I'll manually add links to each publisher's newsletters in that publisher's article. I'll also create a parallel menu structure like I was describing above.

Anyway, that's a lot of background info, with the hope that I'll get some confirmation that I'm not doing something fundamentally flawed.

The problem is that there are external sites linking directly to some URLs like above. I don't want these links to break (classic SEO problem, I believe). I think the solution is to use 301 redirects to (for example) redirect from:

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

to

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

or from

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

to

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

There are various guidelines around for creating 301 redirects in IIS (ex: http://www.webconfs.com/how-to-redirect-a-webpage.php), but I was wondering if these are compatible with Joomla, particularly with Joomla with the SEO features turned on.

Also, if it seems like I'm doing something fundamentally wrong, please let me know :)

Thanks!

A: 

Here is the rewrite section of a web.config file that works. The trickiest part was to figure out that the redirect rules need to preceed the SEO rules in the 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>
Jimmy