0
RewriteEngine On

RewriteCond %{REQUEST_URI} team
RewriteRule ^ http://sitename.co.uk/about? [L,R=301]

The code above works perfectly if the url is /team/

BUT

if the URL is /team/john-smith/ I do not get redirected?

I can't figure out why this wouldn't work! Any ideas??

Thanks in advance

3
  • It's a wordpress site, team is the post type and then it contains posts of team member names Commented Apr 12, 2018 at 15:17
  • ok then keep RewriteRule ^team http://sitename.co.uk/about? [L,R=301,NC,NE] as the first rule below RewriteEngine On rule and test from a new browser. Make sure there are no caching plugins in WP
    – anubhava
    Commented Apr 12, 2018 at 15:19
  • I get this Error in browser: sitename.co.uk redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS Commented Apr 13, 2018 at 8:12

1 Answer 1

0

Have this rule with THE_REQUEST as your top rule:

RewriteEngine On

RewriteCond %{THE_REQUEST} team [NC]
RewriteRule ^team http://sitename.co.uk/about? [L,R=301,NC]

Make sure to use a new browser for testing or completely clear browser cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.