My site is written in PHP. I have changed its urls from php to html and reconvert it in .htaccess
file.
I put autocomplete jquery ui widget in a page of my site and its call to remote file to get suggested items doesn't work. Because the remote url is changed to
search.html?term=spr
I put this line in htaccess file but it doesn't matche because it doesn't consider anything after \.html
.
RewriteRule ^search\.html?term=([^-]+)$ search.php?term=$1 [L,NC,NS]
I also tried
RewriteRule ^search\.html\?term=([^-]+)$ search.php?term=$1 [L,NC,NS]
but both doesn't work.
Would you help me?
Thank you.
You need to tell Apache to append the query string (QSA = Query string append)
^search\.html$
is a regular expression matching a literalsearch.html
.^
matches from the beginning,$
matches till the end and\.
matches a literal dot instead of any character (the special meaning of a dot in regular expressions)This rule...
search.html
(RewriteRule ^search\.html$
)search.php
,[L]
),Search.HTML
would be rewritten too) ([NC]
)[NS]
)search.php
([QSA]
)For an overview of flags: