You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

不带WWW前缀的域名无法显示博客,如何实现重定向?

Hey there! Let’s sort out that annoying non-www to www redirect issue for your blog. Depending on how your server and domain are set up, here are several solid solutions you can try:

1. DNS-Level Redirect (Quick & Easy if Your Registrar Supports It)

Most domain registrars offer a built-in URL forwarding feature. Here’s how it generally works:

  • Log into your domain registrar’s dashboard (where you bought futuristiccreativity.tk)
  • Look for "URL Forwarding" or "Domain Redirect" settings
  • Set the non-www domain (futuristiccreativity.tk) to forward permanently (301) to http://www.futuristiccreativity.tk
  • Save the changes—this usually takes a few minutes to propagate across DNS servers

Pro tip: Always use a 301 redirect here, not 302. It tells search engines the non-www domain is permanently moved to the www version, which helps preserve your SEO rankings.

2. Nginx Server Configuration

If your blog is hosted on an Nginx server, add this server block to your Nginx config file (usually located at /etc/nginx/nginx.conf or in /etc/nginx/sites-available/):

server {
    listen 80;
    server_name futuristiccreativity.tk;
    # Redirect non-www to www with 301 permanent redirect
    return 301 $scheme://www.futuristiccreativity.tk$request_uri;
}

After adding this, test the config with nginx -t to make sure there are no syntax errors, then reload Nginx with systemctl reload nginx (on Linux systems). The $scheme variable automatically uses HTTP or HTTPS, and $request_uri preserves the original page path so users don’t land on the wrong page.

3. Apache Server Configuration

For Apache servers, first make sure the mod_rewrite module is enabled. Then edit your site’s .htaccess file (usually in your blog’s root directory) and add these lines:

RewriteEngine On
# Check if the request is coming from the non-www domain
RewriteCond %{HTTP_HOST} ^futuristiccreativity.tk [NC]
# Redirect all requests to the www version with 301
RewriteRule ^(.*)$ http://www.futuristiccreativity.tk/$1 [L,R=301]

Save the file, and Apache will apply the changes immediately. The [NC] flag makes the condition case-insensitive, [L] tells Apache this is the last rule to process, and [R=301] specifies the permanent redirect.

4. Platform-Specific Fix (e.g., WordPress, Blogger)

If your blog is built on a content management system (CMS) like WordPress:

  • Log into your WordPress admin dashboard
  • Go to Settings > General
  • Update both the WordPress Address (URL) and Site Address (URL) to http://www.futuristiccreativity.tk
  • Save your changes—WordPress will automatically handle the redirect for you. If you still run into issues, combine this with the Apache/Nginx config above for extra reliability.

内容的提问来源于Stack Exchange,提问作者Hanu babbar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 09:17:58