WordPress.org

Support

Support » How-To and Troubleshooting » mod_rewrite help

mod_rewrite help

  • Moderator Jan Dembowski

    @jdembowski

    Brute Squad and Volunteer Moderator

    This is an indirect WordPress question and more of an Apache mod_rewrite question.

    I have been using a translate plugin which I want to disable. Disabling it is not a problem, but I want to re-direct the old permalinks from

    /year/month/day/post-slug-here/es/
    
    or
    
    /$1/$2/$3/$4/$5/

    to send a re-direct to

    /year/month/day/post-slug-here/ (less the es/)

    So that anyone hitting the old URL will go to the original post.

    I figured that I put into my wordpress/.htaccess file

    RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/$ /$1/$2/$3/$4/ [R=301,L]

    The $5 is missing on purpose; I want the language part removed.

    My permalinks are working and .htaccess correctly sends everything to /index.php. Putting the new RewriteRule before or after the WordPress portion does not seem to matter.

    I have added items to my .htaccess before (This trick from whooami works well) but I can’t get this one to work.

    Any help would be appreciated.

  • The topic ‘mod_rewrite help’ is closed to new replies.
Skip to toolbar