Forum Moderators: phranque
Sample 1 URL:
http://www.mydomain.com/?s=no-results:no-results%3Asharon%20milligan&cat=no-results
Sample 2 URL:
http://www.mydomain.com/?s=no-results:no-results&cat=no-results
# Begin of my htaccess file.
options all
RewriteEngine on
RewriteBase /
ReWriteRule no-results /idx/test.php [L]
# Mandatory wordpress code that must stay in place.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule html /cgi-bin/index.pl [L]
RewriteRule ^$ /index.html
# End of mandatory Wp code.
# End of my htaccess file.
# Some other things I tried..
# RewriteCond %{QUERY_STRING} ^=no-results$
# RewriteRule ^.*$ /idx/test.php [L]
RewriteCond %{QUERY_STRING} ^s=no-results(.+)
RewriteCond %{QUERY_STRING} ^s=no-results(.*)
RewriteCond %{QUERY_STRING} ^s=no-results
RewriteCond %{QUERY_STRING} ^([^&]*&)*s=no-results(&.*)?$
[edited by: g1smd at 10:50 pm (utc) on Apr 14, 2011]
this=no-results as there is no beginning anchor to say "begins with" "s=" or is preceded immediately by "&". That's what the (^|&) in my code above does. # Redirect example.com URLs to other site
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.exampleothersite.com/$1 [R=301,L]
#
# Canonicalise all other requests to be www.example.com
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
So for my redirects I should leave the 301 off...I don't understand the question.