1

我想在网站中放置一个 .html 登录页面。我想要的是当用户访问时www.mydomain.com,他们将被重定向到 html 登录页面(我已将其命名为index.html)。然后可以点击指向index.php查看主站点的链接www.mydomain.com/index.php

.htaccess到目前为止,一直在尝试尝试但没有成功(也许我的重写规则是错误的)。这是.htaccess文件的内容:

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .htm .html .php 

# BEGIN WordPress
<IfModule mod_rewrite.c>

  RewriteEngine On
  RewriteBase /

  RewriteRule ^index\.php$ /index.htm [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]

</IfModule>
# END WordPress
4

1 回答 1

1

If you just want people to land on index.html by default and not index.php, then setting the DirectoryIndex would do the job. http://httpd.apache.org/docs/2.0/mod/mod_dir.html

DirectoryIndex index.html

You wouldn't even need rewrites in this case.

于 2012-07-02T10:35:30.570 回答