duanlei2458 2017-02-03 15:31
浏览 387
已采纳

我的wordpress网站将我重定向到我的localhost

my wordpress site works fine with “www.” but when I delete “www” it redirects me to localhost , I tried with .htacess but didn't work

RewriteEngine On 
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC] 
RewriteRule ^(.*)$ example.com/$1 [L,R=301] 

please help

  • 写回答

1条回答 默认 最新

  • dsnd7200 2017-02-03 15:44
    关注

    Show your .htaccess. And remember that .htaccess redirects are cached in browser. Clear cache or open site in new anonymous tab after every change in it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?