2015-03-25 80 views
0

目前,当我打开我的网络应用程序的主URL xyz.com时,它将网页应用程序传送到xyz.com/abc/index.php。如何更改Web应用程序的默认目录访问权限?

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

我想用xyz.com/ghi/index.php而不是xyz.com/abc/index.php打开网页应用程序。

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

+0

你能分享你有任何的代码?没有一些代码示例就很难修复(这可能在你的web服务器的配置中) – 2015-03-25 12:39:49

回答

-1

与下面的代码创建XYZ目录内的index.php文件:

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

简单,把它作为第一线后的index.php文件

header('location:xyz.com/ghi/index.php'); 

否则交友和重定向到URL

0

我认为你可以(也应该)使用.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/$1 [r=301,nc] 

希望这有助于..

相关问题