.htaccess 301 redirect of single page

前端 未结 6 1818
挽巷
挽巷 2020-11-29 02:38

After a site redesign, I\'ve got a couple of pages that need to be redirected. Everything is staying on the same domain, just a couple of things have been reorganised and/or

6条回答
  •  时光取名叫无心
    2020-11-29 03:05

    If you prefer to use the simplest possible solution to a problem, an alternative to RedirectMatch is, the more basic, Redirect directive.

    It does not use pattern matching and so is more explicit and easier for others to understand.

    i.e

    
    
    #Repoint old contact page to new contact page:
    Redirect 301 /contact.php http://example.com/contact-us.php
    
    
    

    Query strings should be carried over because the docs say:

    Additional path information beyond the matched URL-path will be appended to the target URL.

提交回复
热议问题