2

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

Tog Porter
  • 421
  • 1
  • 7
  • 23
  • 2
    Not too sure, but you could try removing the `RewriteBase`. There's also a chance that the hosting provider hasn't enabled the `rewrite_module` in `httpd.conf` - you could always determine that by adding gibberish/random text at the top of the file (if you receive an Internal Server Error, then the module is enabled). – Mike Rockétt Jan 28 '16 at 04:26
  • From what I can gather the Helicon-Ape .Net module is an Apache Emulator which means it won't necessarily be "like for like" have you read through the [Apache compatibility](http://www.helicontech.com/ape/doc/compatibility.htm) there is a useful chart that shows availability of certain features across platforms? The article says *"Helicon Ape is designed to maintain maximum Apache compatibility. Although this target has been achieved at very high level, **some features may not be implemented because they are too bounded to Apache or UNIX design and their implementation on IIS is senseless**."* – user692942 Jan 28 '16 at 10:02
  • I may just be splitting hairs but that rule `RewriteRule ^uk-bed-breakfast-(.*)\.htm /bed-and-breakfast/region.asp\?county=$1 [QSA]` will not match `www.mydomain.com/bed-and-breakfast.asp?county=first` is there some config missing you're not showing? Shouldn't the rule be `ReWriteRule ^uk-bed-breakfast-(.*)\.htm /bed-and-breakfast.asp\?county=$1 [QSA]`? – user692942 Jan 28 '16 at 10:31
  • Hello, Sorry, I made an error in my first question and as I said my comment after posting - the original URL is www.mydomain.com/bed-and-breakfast/region.asp?county=first, and I am trying to change it to www.mydomain.com/uk-bed-breakfast-first.htm. The code I show has worked for several years. Regards, Tog – Tog Porter Jan 28 '16 at 11:45
  • @TogPorter Why not [modify the question](http://stackoverflow.com/posts/35051630/edit) you have the power? – user692942 Jan 28 '16 at 11:46
  • In which case I'd say @MikeRockett is on the money it's likely not enabled. – user692942 Jan 28 '16 at 11:48
  • I have asked the host Co. and they say: "these servers are IIS 8.5 and we have over installed the rewrite module and also added support through helicon ape to run the files". I have read the Apache Compatibility and seen the chart but I don't understand it. For me it might aswelll be in Chinese as it uses so many terms I don't understand. I have concluded therefore that the problem lies with my code but I have no idea how to fix it. :-( – Tog Porter Jan 28 '16 at 23:40
  • The code itself look correct to me, so it should be working fine, which is bad news for you because this means something is wrong with the set up on a host. You say they have both ISAPI_Rewrite and Ape installed at the same time? These products should not be installed simultaneously because they may conflict. You need to contact your host admin and to ask them to check their installation. They can start with some very simple rewrites then follow troubleshooting section from the documentation. Ask them to contact me directly if any issues through Helicon's support. – Yaroslav Jan 29 '16 at 12:30
  • Thank you so much @Yaroslav. The host says the Ape install was the latest download from their website, and they have removed the Isapi rewrite add on, but the problem still exists. I will ask them to contact you. – Tog Porter Jan 30 '16 at 13:05
  • Then can you maybe try with some very simple rule first to prove Ape is working or not. For example try 'RewriteRule . - [F]' in .htaccess, and don't forget RewriteEngine On at the beginning. This rule should block every request to your site. I understand this is rough but you can put it just for few seconds test. – Yaroslav Feb 15 '16 at 11:48

1 Answers1

0

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

Tog Porter
  • 421
  • 1
  • 7
  • 23