I want to rewrite my current URL that is
http://localhost/sitename/landing-page/?from=Algeria&to=Afghanistan&submit=Submit
to http://localhost/sitename/removals-from-Algeria-to-Afghanistan
I have written the rewrite rule for this.
RewriteCond %{THE_REQUEST} ^GET\ /([^/]+)/landing-page/?\?(from)=([^&]+)&(to)=([^&\s]+) [NC]
RewriteRule ^ /%1/removals-%2-%3-%4-%5? [R=301,L]
RewriteRule ^removals-from-([^-]+)-to-([^-]+)$ /removalscenter/landing-page/?from=$1&to=$2&submit=Submit [L]
My htaccess code is..
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /removalscenter/
RewriteRule ^index\.php$ - [L]
RewriteCond %{THE_REQUEST} ^GET\ /([^/]+)/landing-page/?\?(from)=([^&]+)&(to)=([^&\s]+) [NC]
RewriteRule ^ /%1/removals-%2-%3-%4-%5? [R=301,L]
RewriteRule ^removals-from-([^-]+)-to-([^-]+)$ /removalscenter/landing-page/?from=$1&to=$2&submit=Submit [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /removalscenter/index.php [L]
</IfModule>
# END WordPress
Now the link is changed.. but it is giving page not found error..