.htaccessmod-rewritehelicontech

RewriteRule from subfolder path to another subfolder path


I'm currently creating a bunch for RewriteRules for a customer migrating their website to a new platform and having a weird issue with the following rule:

RewriteRule ^/folder/filename.cfm  /another_folder/subfolder/filename.cfm?name=value

I've never had problems with the right side of the rule, which BTW the URL does work. But the left side is my first with a folder.

So what happens is I get as a 404 error. But the following rule will work just fine.

RewriteRule ^filename.cfm  /another_folder/subfolder/filename.cfm?name=value

Anyone have any ideas. BTW, were this is on a Windows system using Helicon Ape Manager.


Solution

  • I guess you are using .htaccess file inside /folder/? Here is quote from Helicon Ape documentation Context and processing order :

    Remember when RewriteRule directive is used inside .htaccess configuration files it will automatically strip the local directory prefix from the path and apply rules only to the remainder. You can use RewriteBase directive to explicitly specify a base path for the rules.