I have a search engine and I am attempting to rewrite the queries. Here is what I have so far in my .htaccess:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} /xanga/search.php$
RewriteCond %{QUERY_STRING} ^query=((.*)+)&search=1$
RewriteRule ^(.*)$ /xanga/keywords-%1? [R=301,L]
RewriteRule ^keywords-(.*)$ /xanga/search.php?query=$1
&search=1&
a=1 [L]
***This works fine and displays the url correctly:
ex.
http://www.mysite.com/xanga/keywords-myquery*** I am running into a problem when I try to send the user to the next page of results. Apache is not redirecting the url at all:
RewriteCond %{REQUEST_URI} /xanga/search.php$
RewriteCond %{QUERY_STRING} ^query=((.*)+)&search=1&st
art=([0-9]
+)$
RewriteRule ^(.*)/(.*)$ /xanga/keywords-%1/%2? [R=301,L]
RewriteRule ^keywords-(.*)/(.*)$ /xanga/search.php?query=$1
&search=1s
tart=$2$a=
1 [L]
</IfModule>
I would like to add that if I manually alter the url in the address bar it attempts to search for the entered string: ex.
http://www.mysite.com/xanga/keywords-myquery/2 will search the database for "myquery/2"
Anyone know how to fix this? Please let me know if I need to give more info.
Start Free Trial