.htaccessurl-rewritingisapiiis-8.5helicon-ape

Is there something wrong with my rewrite code in .htaccess file


I have been demented with this problem for 3 days and no matter how differently I search Google or read the Helion website I cannot understand what I am doing wrong. So, I do hope that someone will be kind enough to help me.

I use a .htaccess file to create search engine friendly URLS and it has worked well for several years.

My web hosting company has now moved my site to a new Windows IIS8.5 server and the rewrites no longer work. They tell me that are using Helicon Ape (not sure what that is). But, I cannot find anything on the Helicon website that makes sense to me, as it is too technical for my old pensioners mind.

Here is a sample of the code that used to work on the old server:

# Helicon ISAPI_Rewrite configuration file
RewriteEngine on
RewriteBase /
RewriteRule ^uk-bed-breakfast-(.*)\.htm /bed-and-breakfast/region.asp\?county=$1 [QSA]

This used to turn

www.mydomain.com/bed-and-breakfast/region.asp?county=first

into

www.mydomain.com/uk-bed-breakfast-first.htm

Now all I get when I use the second URL is a 404 error.

Do I need to make any changes to comply with the newer version of IIS or Helicon Ape Rewrite, and if so what are they


Solution

  • After a lot of painstaking experimentation the problem has at last been solved.

    It seems that with the new iis8.5 server and Helion Ape I needed to put the rewrite rules into a web.config file instead of a .htaccess file.

    The new rule for the example I gave in the question is:

    <rule name="Imported Rule 6">
                        <match url="^uk-bed-breakfast-(.*)\.htm" ignoreCase="false" />
                        <action type="Rewrite" url="/bed-and-breakfast/region.asp?county={R:1}" appendQueryString="true" />
                    </rule>
    

    Using this system the website is at last functioning correctly.

    Many thanks to all who tried to help.

    Tog