简体   繁体   English

Index.php代替Index.html,如何访问,我显然必须更改的.htaccess文件在哪里?

[英]Index.php instead Index.html, how to access, and where is the .htaccess file that i have apparently have to change?

so i downloaded a website template, unzipped it, and uploaded it on my host on bluehost, just to test it out. 所以我下载了一个网站模板,将其解压缩,然后将其上传到我在bluehost上的主机上,以进行测试。 I tested several, but one of them didn't work, and it seems it's because that one has a Index.php instead of a Index.html file. 我测试了几个,但是其中一个没有用,这似乎是因为其中一个具有Index.php而不是Index.html文件。 I did some research, and stumbled upon things like redirecting the site to the php file instead of the html and such. 我做了一些研究,偶然发现了将网站重定向到php文件而不是html之类的东西。 Also, something with .htaccess...i have a lot of questions regarding this, but for now i just want to know how to treat this index.php like if it was an index.html. 另外,带有.htaccess的东西...我对此有很多疑问,但是现在我只想知道如何像对待index.html一样对待这个index.php。

I searched for .htaccess to change the parameter to make it load .php instead of .html 我搜索了.htaccess来更改参数,以使其加载.php而不是.html

<?php
/**
 * The template for displaying the header
 *
 * Displays all of the head element and everything up until the page header div.
 *
 * @package Neve
 * @since   1.0.0
 */

$header_classes = apply_filters( 'nv_header_classes', 'header' );
?><!DOCTYPE html>
<html <?php language_attributes(); ?>

I just guess that i need to change the above header or some alternative of it. 我只是想我需要更改上面的标头或它的某些替代方法。 Please help. 请帮忙。 Thank you! 谢谢!

Btw: my website: https://sumproblems.com/ (i hope it is allowed to link this here. if not, sorry!) 顺便说一句:我的网站: https : //sumproblems.com/ (我希望它可以在这里链接。如果没有,对不起!)

As long as the index.php is the only file named index in the directory, the webserver will show it. 只要index.php是目录中唯一名为index的文件,Web服务器就会显示它。

Not sure if you have tried this but, remove everything you've uploaded (in this case, the templates) from the main website directory (where you've placed the templates) and just upload the one with the index.php file. 不确定是否尝试过此方法,但是,请从主网站目录(放置模板的位置)中删除已上传的所有内容(在本例中为模板),然后仅将其中包含index.php文件的内容删除。 Usually, there's no need to change anything on the .htaccess file, as the web server will recognize that he needs to show that file in the first place. 通常,不需要更改.htaccess文件上的任何内容,因为Web服务器会认识到他需要首先显示该文件。

About the location of the .htaccess file: It should be on the main directory. 关于.htaccess文件的位置:它应该在主目录中。

If this does not work, post a link to Pastebin or any other service of your choice with the contents of the .htaccess file so we can take a look. 如果这不起作用,请使用.htaccess文件的内容发布指向Pastebin或您选择的任何其他服务的链接,以便我们查看。

The thing is that you are trying to view a WordPress theme, without the installation of WordPress. 问题是您尝试查看WordPress主题,而未安装WordPress。

You need first to download and install WordPress on your hosting and then upload this theme via WordPress admin (very easy). 您首先需要在主机上下载并安装WordPress ,然后通过WordPress管理员上传此主题(非常简单)。 Good luck with that and enjoy WordPress 祝你好运并享受WordPress

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

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