Stripping all queries using .htaccess
-
I recently moved my blog from Movable Type to WordPress. My permalink structure is –
https://www.mywebsite.com/category_name/entryname.phpMovable Type paginated by adding a query to the index page. For eg – https://www.mywebsite.com/apple/index.php?page=3 where as WordPress paginates https://www.mywebsite.com/apple/3 but what has happened is Google has cached my previous pagination and keeps on crawling the url’s by mixing the parameters. So the Googlebot would crawl – https://www.mywebsite.com/apple/3?page=3 as well. My website has a large number of posts so this adds to a lot of unnecessary pages being crawled.
I would want to strip all incoming queries and redirect the user to the page without the query using .htaccess.
This is my current .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</IfModule>
What rules should I add a 301 to any and all queries and direct the user to the page without the query.
- The topic ‘Stripping all queries using .htaccess’ is closed to new replies.