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

如何通过cPanel文件管理器重定向网站首页?含指定域名路径重定向咨询

Hey Bryce, great questions—let's walk through exactly how to handle both homepage redirects using cPanel's File Manager. I'll break it down step by step so it's easy to follow:

1. How to Redirect Your Website's Homepage via cPanel File Manager

Here's the full workflow to set up a homepage redirect using the built-in File Manager:

  • Log into your cPanel account, then locate and launch the File Manager tool (it’s usually grouped under the "Files" section).
  • Navigate to your website’s root directory—this is almost always the public_html folder (where your main site files and folders are stored).
  • Look for the .htaccess file. If it’s not visible, click the "Settings" button in the top-right corner, check the box labeled "Show Hidden Files (dotfiles)", and hit "Save" to reveal it.
  • Right-click the .htaccess file and select "Edit" (or use the "Edit" button in the top toolbar). You might see a warning about editing system files—just click "Edit" again to proceed.
  • Add the following redirect rule at the top of the file (before any existing code, to ensure it takes priority):
    Redirect 301 / https://your-target-domain-or-path.com
    
    Note: Use 301 for a permanent redirect (best for SEO and long-term changes) or 302 for a temporary redirect.
  • Click "Save Changes" in the top-right, then close the editor. Test the redirect by visiting your homepage to confirm it works as expected.
2. Redirecting example.com.sg to example.com.sg/test

For your specific use case (redirecting the root domain to a subpath), the process is identical to the above—you just need to use the exact target path in your rule:

  • Follow steps 1-4 from the first section to open your .htaccess file in File Manager.
  • Add this rule at the top of the file:
    Redirect 301 / https://example.com.sg/test
    
  • Save your changes, then test by visiting example.com.sg—it should automatically redirect you to the /test subpath.

A quick heads-up: If you have existing rules in .htaccess (like WordPress permalinks or other redirects), placing this new rule at the top ensures it runs first, so your homepage redirect takes precedence over other settings.

内容的提问来源于stack exchange,提问作者Bryce

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.11 08:00:36