htaccess 将 example.com/index.php 重定向到 example.com/home
预先感谢,我正在尝试将输入 example.com 或 example.com/index.php 的任何人重定向到 example.com/home
请让我知道,我已经尝试了重定向永久和 301 的 htaccess 规则,但他们还没有工作了。我的页面是动态创建的。
Thanks in advance, I am trying to redirect anyone who types in example.com or example.com/index.php to example.com/home
Please let me know, I have tried the htaccess rules of redirect permanent and 301's and they have not worked. My pages are created dynamically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,确保您的语法正确。这是您的 .htaccess 文件的样子吗?
如果您确定,请尝试以下操作:
First, make sure your syntax is correct. Is this what your .htaccess file looked like?
If you're sure, try this:
你不能直接放置一个 php 脚本来重定向访问者吗?以下应该可以工作,将其保存为根目录中的index.php。
Couldn't you just put a php script to redirect visitors? The following should work, save it as index.php in your root directory.