如何使目录打开到某个路径?

示例:具有目录 Directory1 的网站,其中包含 index.php 的文件夹,那么如何使 Directory1 在 index.php 上自动打开?

当用户输入 - www.Example.com/Directory1 - 我想将他重定向到 www.Example.com/Directory1/Folder/index.php 我试图通过 $_GET 检查但没有工作


30秒到达战场
浏览 146回答 2
2回答

慕娘9325324

将您的正文标签更改为此正文 onload="redirect()"只需将其粘贴到 www.Example.com/Directory1 中正文标签的结尾之前&nbsp; &nbsp;<script>&nbsp; &nbsp;function redirect(){&nbsp; window.location.replace("www.Example.com/Directory1/Folder/index.php");&nbsp; }&nbsp;&nbsp; </script>

慕姐4208626

此示例将 ROOT 域的 URL 重定向到任何子目录。在这个例子中,它会自动加载 example.com/subdir1:将此代码放在 .htaccess 文件中RewriteEngine onRewriteRule ^$ /subdir1/ [L]
打开App,查看更多内容
随时随地看视频慕课网APP