简体   繁体   English

如何从index.html在私有文件夹中运行index.php

[英]How do I run index.php in a private folder from index.html

I have a website that has a root html at index.html. 我有一个网站,其根HTML位于index.html。 I want to redirect index.html to a php file in a private folder one parent above to run an index.php. 我想将index.html重定向到上面一个父文件夹中的私有文件夹中的php文件,以运行index.php。 This file would then render the html content that I need depending on the request. 然后,此文件将根据请求呈现所需的html内容。 How would I go about this process of getting the index.php from the index.html. 我将如何处理从index.html获取index.php的过程。 The file structure looks like this: 文件结构如下所示:

private/
   -index.php

public_html/ 
   -index.html

Try to use this meta code in your index.html 尝试在index.html中使用此元代码

 <meta http-equiv="Refresh" content="0; url=/private/index.php">

It's an html redirection actually. 实际上,这是一个html重定向。

If this doesn't work, try to hook in htaccess 如果这不起作用,请尝试挂接htaccess

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

相关问题 如何让 ovh 从 index.html 而不是 index.php 运行我的网站? - how to make ovh run my website from index.html and not index.php? 如何使用Shell脚本使&#39;index.php&#39;的优先级高于&#39;index.html&#39;的优先级 - How do i make 'index.php' higher priority than 'index.html' with a Shell script 将默认页面从index.php更改为index.html - Change default page from index.php to index.html Laravel 从 index.php 和 index.html 重定向到域 - Laravel redirect from index.php and index.html to domain 对于以表单结尾的单页网站:是否必须将index.html转换为index.php? - For a Single-Page-Website with a form at the end: Do I have to convert the index.html into index.php? 如何正确地将 Angular index.html 文件替换/重命名为 index.php? - How can I properly replace/rename Angular index.html file to index.php? 我如何在cordova中使用index.php而不是index.html? - how can i use index.php instead of index.html in cordova? 如何使用 index.php 而不是 index.html 在 XAMP 上运行由 create-react-app 创建的 ReactApp? - How to run ReactApp created by create-react-app on XAMP using index.php rather than index.html? 服务器页面在index.php或index.html之间的优先级 - Server page priorities between index.php or index.html 使用index.php而不是index.html是不好的做法吗? - Is it bad practice to use index.php instead of index.html?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM