Jump to content

Bill in Kansas City

  • Posts

  • Joined

  • Last visited

Posts posted by Bill in Kansas City

  1. If it works, don't fix it, right? 

    Some general info you might find useful: Windows servers don't use .htaccess. Instead, all meta data regarding your site's behavior (including URL rewrites/redirects) are contained in web.config (as you've already noted.) The syntax is similar: a rule written for .htaccess can be used in web.config by just plugging in the values in the right spots, e.g.

    RewriteRule ^$ /index.php [L,R=301]


    <rule name="home">
        <match url="^$" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
        <action type="Rewrite" url="/index.php" />

    Search up "regular expressions" for more details on how the matching syntax works. Writing web.config by hand isn't fun, per se, but as you've discovered, it can be done.

    • Like 1
  2. I'm on a Windows server, so it uses IIS' URLRewrite module.

    Adding in the two rewrite conditions fixed the issue. I went through the products and made sure that ".html" is present on all of them, and that is now the default setting. For those who might need it, the rule looks like this:

                    <rule name="generic rewrite" enabled="true" stopProcessing="true">
                        <match url="^(.*?)$" />
                        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <action type="Rewrite" url="/index.php?seo_path={R:1}" appendQueryString="false" logRewrittenUrl="true" />

    So far as I can find, IIS doesn't have a 1:1 equivalent to FilesMatch, and certainly not a way to specify blank 404 content.

    Man, what a pain. Don't they have a QA department? 

    Thanks for your time and help!

  3. The change completely breaks the website, because if I put that rule in, the link to EVERYTHING else - stylesheets, javascript, images - stops working. My regex-fu isn't great enough to create a rule that works around THAT, and the "add html" doesn't appear to work either (unless that's only for new products.)

    ...and as long as we're here, the category links have stopped working as well. Time for a different cart, I guess. This is wayyy too much trouble.

  • Create New...