how to strip unsollicited chars at the end of URL htaccess

Discussion in 'Apache' started by jlaurier, Jan 11, 2013.

  1. #1
    Hi, I use WordPress and one Template added .menu to all of my URLs. I changed my Template and i got many 404. I d like to strip the ".menu" chars at the end of each Url and use a 301 redirect for Google to find the new right URL. I would like to redirect Url like"http://mydomain.com/my-url/.menu" to "http://mydomain.com/my-url/""http://mydomain.com/my-url-2/.menu" to "http://mydomain.com/my-url-2/""http://mydomain.com/my-url-3/.menu" to "http://mydomain.com/my-url-3/"... and so onthank you
     
    jlaurier, Jan 11, 2013 IP
  2. ryan_uk

    ryan_uk Illustrious Member

    Messages:
    3,983
    Likes Received:
    1,022
    Best Answers:
    33
    Trophy Points:
    465
    #2
    Try something like this as part of your rewrite rules:

    RewriteRule (.*)\.menu $1 [R=301,L]
    Code (markup):
     
    ryan_uk, Jan 11, 2013 IP