Forum Moderators: phranque
Here is the code I have been using;
# Search
RewriteCond %{QUERY_STRING} ^q=$
RewriteRule . [%{HTTP_HOST}...] [L,R]
RewriteRule ^search/$ /index.php?&a=search [QSA,L]
RewriteRule ^search/([0-99]+)/?$ /index.php?&a=search&postpage=$1 [QSA,L]
I appreciate all your help/suggestions on this.
Many thanks,
~ KLS ~
You can use a rewriterule to clean up search engine results and prevent errors from links and bookmarks that have been created using the incorrect URLs, but you need to fix the problem at its source. For some reason, the PHP code is double-escaping the single quote when the previously-escaped query is used to 'build' the query for the next page. It's a rather obvious bug, and should be easy for you or the developer to to fix: If the pagination function is called for the first time, then escape all characters, but if it is being called for a second or subsequent page, or by a "next" or "previous" function, then only escape slashes if they don't precede a character that needs to be escaped.
If you can't get this fixed in the source code, please post again. I've got some code lying around to extract pieces of the query string, but it is complex and nasty to decipher.
Jim