0

I need a help, does anyone can tell me how to change a url

"http://www.domain.com/search.php?key=+Ebooks&type=title&Submit=Search"

to

"http://www.domain.com/keyword- keyword- keyword.html".

i have written following htaccess code but its not working.

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteRule search-(.*)-(.*)-(.*)\.html search.php?key=$1&type=$2&page=$3
</IfModule>
Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
akku
  • 71
  • 5

2 Answers2

0

What exactly does not work? Is anything happening?

I am not 100% sure but I think you have to do it this way:

search-(.*?)-(.*?)-(.*?)\.html search.php?key=$1&type=$2&page=$3

Notice the ? behind the asterisks. It indicates to match a string as early as possible.

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
0

Try this:

RewriteRule search-([^-]*)-([^-]*)-([^-]*)\.html search.php?key=$1&type=$2&page=$3
Stuart Sierra
  • 10,837
  • 2
  • 29
  • 35