Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 写入htaccess以在同一目录中加载index.html和index.php_Wordpress_.htaccess_Mod Rewrite - Fatal编程技术网

Wordpress 写入htaccess以在同一目录中加载index.html和index.php

Wordpress 写入htaccess以在同一目录中加载index.html和index.php,wordpress,.htaccess,mod-rewrite,Wordpress,.htaccess,Mod Rewrite,我的情况有点复杂。我正在处理一个带有enter链接(index.php)的登录页。登录页是index.html,但是,我使用wordpress重写规则加载整个站点,就像它在索引目录中一样 wordpress文件位于/wordpress/中,而从mydomain.com加载时,网站加载的每个页面都不带/wordpress/ 问题是,在加载mydomain.com时,默认情况下会加载index.html。该链接包含index.php href,但单击后会返回index.html。我知道它为什么这样做

我的情况有点复杂。我正在处理一个带有enter链接(index.php)的登录页。登录页是index.html,但是,我使用wordpress重写规则加载整个站点,就像它在索引目录中一样

wordpress文件位于/wordpress/中,而从mydomain.com加载时,网站加载的每个页面都不带/wordpress/

问题是,在加载mydomain.com时,默认情况下会加载index.html。该链接包含index.php href,但单击后会返回index.html。我知道它为什么这样做,但不知道如何做,或者是否有可能制定一个重写规则来帮助这种情况

以下是我的访问权限:

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

# END WordPress
#开始WordPress
重新启动发动机
重写BASE/wordpress/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/wordpress/index.php[L]
#结束WordPress

任何帮助或指导都将不胜感激。谢谢大家!

我想这会对你有帮助


DirectoryIndex.html index.htm default.htm index.php index.php3 index.phtml index.php5 index.shtml mwindex.phtml

提供有关如何为索引定义href的详细信息。php@OlegGryb你是说?是的,我不明白为什么当你点击这个链接时它会重定向回index.html。既然你写下你确实理解,也许你可以解释。如果我没有这个问题,我不会问社区。我也不知道为什么,尽管它可能来自于行重写规则/wordpress/index.php[L]。我相信这是因为试图调用一个重写为默认目录的索引,基本上是在调用时从路径中删除/wordpress/。这条规则可以解释为什么它会被重定向到index.php,但我仍然不明白如何将它重定向回index.html。可能您应该提供有关index.html页面的更多详细信息。“href”可能有问题