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

时间:2014-07-28 04:28:25

标签: wordpress .htaccess mod-rewrite

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

wordpress文件在/ wordpress /中,而从mydomain.com加载的网站加载每个页面时没有/ wordpress /。

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

这是我的htaccess:

# 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

感谢任何帮助或指导。谢谢!

1 个答案:

答案 0 :(得分:1)

我认为这会对你有所帮助。

Make index.html default, but allow index.php to be visited if typed in

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