: I'm assuming (looking at your RewriteRule pattern) that this .htaccess file is located in the /removalscenter directory? (Although the first couple of directives are generic, allowing for <sitename>,
I'm assuming (looking at your RewriteRule pattern) that this .htaccess file is located in the /removalscenter directory? (Although the first couple of directives are generic, allowing for <sitename>, the remaining directives appear to be hardcoded?)
By setting a RewriteBase directive, you don't need to specify the full path for the RewriteRule substitutions - that is the reason for using RewriteBase. You can keep the RewriteRule substitution as relative (simplifying the rules) . For example:
RewriteRule . /removalscenter/index.php [L]
Can simply be:
RewriteRule . index.php [L]
localhost/sitename/landing-page/?from=Algeria&to=Afghanistan&submit=Submit
Your example URL does not look like the full URL. It's missing the index document eg. index.php. If you don't explicitly state this then mod_dir will need to "fix it", resulting an additional rewrite which might be causing problems. So, this should be something like:
localhost/sitename/landing-page/index.php?from=Algeria&to=Afghanistan&submit=Submit
Likewise, the trailing slash should not be optional in your RewriteCond directive.
In order to debug the 404 further, try temporarily changing the internal rewrite to a temporary (302) external redirect by adding an R flag. For example:
RewriteRule ^removals-from-([^-]+)-to-([^-]+)$ landing-page/index.php?from=&to=&submit=Submit [L,R]
Does it redirect? What does it redirect to?
More posts by @Jamie184
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.