.htaccess redirect all pages to new domain

前端 未结 18 2286
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 14:47

Which redirect rule would I use to redirect all pages under olddomain.example to be redirected to newdomain.example?

The site has a totally

18条回答
  •  花落未央
    2020-11-22 15:22

    Use conditional redirects with Options -FollowSymLinks and AllowOverride -Options disabled by the Hoster if a few local files should be served too:

    Sample .htaccess

    # Redirect everything except index.html to http://foo
    
        Redirect 301 / http://foo/
    
    

    This example will serve local index.html and redirects all other staff to new domain.

提交回复
热议问题