Skip to content
Advertisement

htaccess redirect POST message to php file in subfolder

I hope someone can help me to correct my htaccess problem in a shared hosting scenario, so I don’t have access to httpd.conf. I am trying to redirect a POST to /process-dev.php to the file in the correct subfolder as shown below, but instead my POST gets redirected to index.php
The POST comes from the webpage itself (actual domain replaced with subdomain1.com) https:://www.subdomain1.com.

JavaScript

My htaccess file

JavaScript

The partly output of print($_server)

JavaScript

Advertisement

Answer

The problem lies in

JavaScript

You are using $1 but there is no grouped pattern in the RewriteRule (^.*$), you ment to use %1 to refer to a group in the earlier RewriteCond.

Also, i’m not sure if you really ment to put that second ? in the RewriteCond pattern ? I doubt you wanted that part of the uri to be optional in order to match this rule.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement