wordpress安装目录下的非wordpress文件 [英] non-wordpress files in wordpress installation directory

查看:32
本文介绍了wordpress安装目录下的非wordpress文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在根目录中安装了 wordpress.在同一目录中有一个文件 test.html.我无法使用此网址打开此文件 www.mysiet.com/test.html.当我打开这个文件时,我得到没有找到帖子".(我自己编写了 wordpress 的模板,如果没有找到帖子,这条消息在 index.php 中).所以我的问题是:

I have installed wordpress in root directory. There is a file say test.html in same directory. I can not open this file www.mysiet.com/test.html with this url. When i open this file i get 'No posts found'.(I have coded wordpress's template on my own and this message is in index.php if no posts found). so my questions are:

  1. 如何打开根目录下的html文件.

  1. How can i open an html file that is placed in root directory.

我可以在根目录中创建一个新文件夹并在该目录中安装另一个 wordpress 站点,而根目录已经安装了 wordpress.

Can i create a new folder in root directory and install another wordpress site in that directory while root directory already have a wordpress installation.

我可以在根目录(已经安装了 wordpress)中创建一个新文件夹并将一些文件放在该新目录中并通过我的浏览器访问它们.

Can i create a new folder in root directory (that already has wordpress installed in it) and place some files in that new directory and access them via my browser.

谢谢

推荐答案

在根文件夹中打开你的 .htaccess,一旦打开应该是这样的

Open your .htaccess in the root folder which once opened should look something like this

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress`

然后在所有这些之上添加这个并将您的目录放在指定的位置替换带有子目录名称",您可以添加任意数量的子目录

Then add this above all of that and place your directory in designated spot "replace with subdirectory name" you can add as many subs as you like

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/REPLACE WITH SUB DIRECTORY NAME/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/REPLACE WITH SECOND SUBDIRECTORY NAME/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>`

如果我的子目录被命名为 other,最终结果应该是这样的

Final Result should look like this if my subdirectory was named other

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/other/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress`

这篇关于wordpress安装目录下的非wordpress文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆