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.
<I开发者_运维知识库fModule mod_rewrite.c>
RewriteEngine on
RewriteRule search-(.*)-(.*)-(.*)\.html search.php?key=$1&type=$2&page=$3
</IfModule>
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.
Try this:
RewriteRule search-([^-]*)-([^-]*)-([^-]*)\.html search.php?key=$1&type=$2&page=$3
精彩评论