- 最新
- 最多得票
- 最多評論
I don't think that other thread they referred to is particularly relevant to your problem.
Both the root domain and the www subdomain are already resolving to the same IP address, so you don't need to make any changes in DNS. What you need is a 301 redirect from non-www to www (or vice versa, depending on your preference).
There are several ways to go about this. First, make sure your preferred domain is set in Settings > General in the Wordpress admin interface. Then insert these lines into the wp-config.php file:
define('WP_HOME',"http://www.exeterstreethall.org");
define('WP_SITEURL',"http://www.exeterstreethall.org");
Another is through the .htaccess file. Since Apache is your web server, there will be a file called .htaccess in the root folder of your website (where you can also find folders such as wp-includes and wp-content). It already includes a bunch of things for WordPress. Insert the following:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^exeterstreethall.org [NC]
RewriteRule ^(.*)$ http://www.exeterstreethall.org/$1 [L,R=301]
I don't see how not having the redirect would force Wordpress into safe mode, but it's certainly a good idea to have one canonical address instead of two "copies" of the same site on different (sub)domains.
Alternatively, there are plug-ins available that will help you set up redirects, but I'd use those as a last resort.
Hi, trying to solve the same issue. Use the same code in the .htaccess with no luck. Seems the system has updated the way it handles things.
Any updated solution?
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 10 個月前