简体   繁体   English

子页面始终打开域根目录

[英]Sub-pages always open domain root

I'm having a strange problem with a new PHP page I´m writing. 我正在编写一个新的PHP页面时遇到一个奇怪的问题。 Everything seems to be loading/redirected to the domain root page. 一切似乎都已加载/重定向到域根页面。

  • domain.com loads fine domain.com加载正常
  • domain.com/page or domain.com/page/index.php always loads "domain.com" while retaining the /page/index.php in the browser URL. domain.com/pagedomain.com/page/index.php始终加载“ domain.com”,同时在浏览器URL中保留/page/index.php。
  • Even domain.com/some_random_text loads "domain.com" 甚至domain.com/some_random_text也会加载“ domain.com”

I suspected the .htaccess file, but there is none to be found. 我怀疑.htaccess文件,但没有找到。 There are no redirects in the PHP code. PHP代码中没有重定向。

If I remove the domain.com/index.php file I get an Internal Server Error when opening domain.com/page/index.php 如果我删除domain.com/index.php文件,则在打开domain.com/page/index.php时出现内部服务器错误

This domain did have Wordpress installed, but I did uninstall that via cPanel. 此域确实安装了Wordpress,但我确实通过cPanel卸载了该域。

First thing to notice is that the .htaccess file can be anywhere in the path that is handled by Apache. 首先要注意的是, .htaccess文件可以位于Apache处理的路径中的任何位置。 So check everywhere. 所以到处检查。 This kind of redirect could be made only like that. 只能这样进行这种重定向。

This can only be done by Apache, so you might also like to check the apache config if you are running on a virtual machine or dedicated server. 这只能由Apache完成,因此,如果您正在虚拟机或专用服务器上运行,则您可能还想检查apache配置。

Also, not that it might have been a wildcard redirect, added by the cPanel, so check those settings. 另外,并不是说它可能是cPanel添加的通配符重定向,所以请检查那些设置。 Though I think those actually just modify the root .htaccess file. 虽然我认为这些实际上只是修改根.htaccess文件。

Based on the data you provided I cannot say more, but I don't think this is a common issue. 根据您提供的数据,我无法多说,但我认为这不是一个普遍的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM