简单的 php 标头重定向在添加域中不起作用
我正在使用一个非常简单的标头重定向:
<?php header('Location: http://www.example.com'); ?>
我在附加域中使用它,因此目录结构如下所示:
/home/username/public_html/addondomain.com/goto/directory/redirect.php
当我将其放在这个目录中时它不起作用,但它确实可以在我的另一个目录中工作主账户。例如:
/home/username/public_html/recommends/redirect.php
看起来是目录权限的问题,但似乎一切都很好。这可能是附加域的问题吗?
这可能是非常简单的事情,但我就是无法弄清楚。任何帮助将不胜感激。
谢谢 巴里
I am using a very simple header redirect:
<?php header('Location: http://www.example.com'); ?>
I am using this in an add-on domain so the directory structure looks like this:
/home/username/public_html/addondomain.com/goto/directory/redirect.php
It doesn't work when I have it in this directory, but it does work in a different directory in my main account. For example:
/home/username/public_html/recommends/redirect.php
It would seem to be a problem with the directory permissions, but everything seems to be fine. Is this possibly a problem with the add on domain?
This is probably something really simple, but I just can't figure it out. Any help would be appreciated.
Thanks
Barry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法使用 .htaccess 自己解决了这个问题。感谢大家的评论。
下面是我使用的代码示例:
现在调用一个名为 link.php 的 php 文件,该文件从 MySQL 数据库查找用户信息以完成链接。 link.php 文件使用 header() 函数重定向到新创建的链接。这样我就可以拥有无限的会员创建自定义链接。
I managed to fix this myself using .htaccess. Thanks everyone for your comments.
Here is a sample of the code I used:
This now calls a php file called link.php which looks up the user information from the MySQL database to complete the link. The link.php file redirects to the newly created link using the header() function. This way I can have unlimited affiliates creating custom links.