如何更改 Web 应用程序的默认目录访问权限?

How to change default directory access for a web app?

目前,当我打开我的网络应用程序的主要 URL xyz.com 时,它会将网络应用程序带到 xyz.com/abc/index.php。

除了我的网络应用程序中的 'abc' 之外,我还有另一个名为 'ghi' 的目录。

我希望网络应用程序以 xyz.com/ghi/index.php 打开,而不是 xyz.com/abc/index.php。

我如何实现这一点,以便在浏览器中输入 xyz.com 时,网络应用程序被带到 xyz.com/ghi/index.php 而不是 xyz.com/abc/index.php?

使用以下代码在 xyz 目录中创建文件 index.php:

<html>
 <a href="/ghi">Click Here</a>
</html>

简单的把它放在index.php文件

之后的第一行
 header('location:xyz.com/ghi/index.php');

否则 Cpanel 并重定向到 URL

我认为您可以(并且应该)使用 .htaccess 文件实现此目标。 这是通过 this tool

生成的样本
//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com/ghi/index.php[nc]
RewriteRule ^(.*)$ http://www.example.com/ghi/index.php/ [r=301,nc]

希望这对您有所帮助..