Error in .htaccess file on Windows server running Helicon Ape

I am using an .htaccess file with Helicon Ape on a Windows server to do URL redirects. I have the following code in .htaccess which was on an older Linux server and was working:

RewriteEngine On

Redirect /berks-ham-steak-parmesan/ http://www.domain.com/recipe-ham/?id=38

Open in new window


However, on the Windows server with Helicon Ape, it does not work, and I see this message in the logs:

[2018-02-27 19:46:18.883] [ConfigLoader:85] (error) [/_ape_start_developer_session] d:\domain.com\wwwroot\.htaccess(28): Invalid command 'Redirect /berks-ham-steak-parmesan/ http://www.domain.com/recipe-ham/?id=38' on line 28, perhaps misspelled or defined by a module not included in the server configuration

Open in new window


Is there some other way I should be handling Redirect? Is that no longer a valid command, or is it an incompatibility with Helicon Ape?

Thank you.
Brad BansnerWeb DeveloperAsked:
Who is Participating?
 
Dr. KlahnPrincipal Software EngineerCommented:
For better compatibility with common mod_rewrite usage, this could read:

RewriteCond {REQUEST_URI} ^/berks-ham-steak-parmesan/
RewriteRule .* http://www.domain.com/recipe-ham/?id=38

Open in new window


If this redirection is not going to a different server, the RewriteRule can be simpler:

RewriteCond {REQUEST_URI} ^/berks-ham-steak-parmesan/
RewriteRule .* /recipe-ham/?id=38

Open in new window

0
 
Brad BansnerWeb DeveloperAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.