I've just launched a new worpdress site which replaces an old asp site.
While google is re-indexing i've been asked to make sure that key pages get redirected.
For example: www.egmont.co.uk/default.asp?pageid=3 needs to go to http://www.egmont.co.uk/who-we-are/what-we-do/books/
Googling has led me to construct the following, but it doesnt work, can anyone tell me why?:
RewriteEngine on
RewriteCond %{QUERY_STRING} pageid=3
RewriteRule /who-we-are/what-we-do/books/ [L,R=301]
You're close but remember that RewriteRule
syntax is:
RewriteRule <pattern-to-match-in-uri> <target-uri> <flags>
You can try this rule:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^pageid=3(&|$) [NC]
RewriteRule ^default\.asp$ /who-we-are/what-we-do/books/? [L,R=302,NC]
302
to 301
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.