0

I use the code below in a Codeigniter htaccess file

RewriteRule ^([^.]+)-vacation$ /search?location=$1

When i access it with the url www.example.com/moscow-vacation, it gives me a 404 error.

I have used the above htaccess code in a core php application. It works fine there.

Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198
  • @olaf there is no method called location, i get the values from url using $this->input->get() and i am using index method of search controllers – Meerutwala Portal Apr 21 '13 at 20:32

1 Answers1

0

Most likely, you don't have a search script. If the script is named search.php, you can use this slightly modified rule

RewriteRule ^([^.]+)-vacation$ /search.php?location=$1

If you have a controller named Search with a method location, you can either rewrite directly to

RewriteRule ^([^.]+)-vacation$ index.php/search/location/$1

or try

RewriteRule ^([^.]+)-vacation$ search/location/$1
Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198