I bought a site but all the error logs are showing invalid requests to pages that don't exist: /?p=32 /?p=250 - Can I redirect them in one go using .htaccess to the / page?
This should work: <IfModule mod_rewrite.c> RewriteCond %{QUERY_STRING} ^p=1$ RewriteRule (.*) http://url-to-redirect-to/ [R=301,L] </IfModule> Code (markup):
Sorry should have tested it first... Try this instead, should work: RewriteCond %{QUERY_STRING} /?p=(\d*) RewriteRule ^$ ? [R=301,L] Code (markup):
Thanks that's better but it doesn't redirect to url-to-redirect-to like it did before? Could you fix it? thanks man