Forcing non-www url in Wordpress installation causes infinite loop

前端 未结 2 973
攒了一身酷
攒了一身酷 2021-01-28 08:23

I am trying to rewrite http://www.domain to http://domain in a wordpress installation, but it looks like it\'s making the url loop from http://www to http:// and back to http://

2条回答
  •  一个人的身影
    2021-01-28 08:50

    It looks like you made changes to your .htaccess file that aren't necessary. To fix this problem change your .htaccess file back to default wordpress value which is:

    # BEGIN WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    

    Now that your .htaccess file is back to normal, login to your wordpress dashboard and click on Setting -> General. You'll see two text boxes labeled "WordPress address (URL)" and "Site address (URL)". Change the URL in both of these fields and you can remove the www part if you don't want that in your site URL. Save the changes and you're good to go! Here's a screenshot of the settings page so you can see the exact fields:

    Hope this answers your question!

提交回复
热议问题