I think the problem are the missing placeholders. Without the placeholders your stated URL
http://www.mysite.pk/jobs/search/faisalabad/all-cats
won't match.
The correct route should look like this:
$route["jobs/pakistan/(:any)"]="vacancies/search";
$route["search/pakistan/(:any)"]="vacancies/search";
This way both jobs/pakistan and search/pakistan are working.
Edit
This RewriteRule will have the same effect when put in the .htaccess file.
RewriteRule ^jobs/search/(.*)?$ http://www.mysite.pk/jobs/pakistan/$1 [L,R=301]
Your .htaccess file then should look similar to this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]
###
RewriteRule ^jobs/search/(.*)?$ http://www.mysite.pk/jobs/pakistan/$1 [L,R=301]
# Removes access to the system folder by users.
# Additionally this will allow you to create a System.php controller,
# previously this would not have been possible.
# 'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# Without mod_rewrite, route 404's to the front controller
ErrorDocument 404 /index.php
</IfModule>
The RewriteRule has following scheme:
RewriteRule [output] [original]
In this case when the "output" (url) starts with jobs/search/
(the ^ marks the beginning and $ the end) everything after this will be redirected to the original. The (.*)
marks a reference for any content and will be inserted in the origin in place of $1
. The [L,R=301]
marks the type of the redirect (the HTTP response status code 301 means Moved Permanently), the L
means that after the route is met, the following lines won't be processed.