htaccess全部重写为index.html [英] htaccess rewrite all to index.html

查看:49
本文介绍了htaccess全部重写为index.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写.htaccess文件,以便无论用户请求什么,他都将拥有页面index.html

I'm trying to write the .htaccess file so that whatever the user requests, he will have the page index.html

我写了这个:

Options +FollowSymlinks
RewriteEngine on
RewriteRule .* index.html [NC]

我知道这将导致:无论传入请求URL是什么,即www.domain.com/***(斜杠之后的内容),结果将是页面www.domain.com/index.html

I understand that this will cause: whatever the incoming request URL is, i.e, www.domain.com/*** (whatever comes after the slash), the result will be the page www.domain.com/index.html

但是,出现服务器错误.我想念什么?

However, I'm getting a Server error. What am I missing?

注意:我不希望它是永久重定向,我只是想在index.html页面上隐藏"我网站的内容几个小时(这表明该网站正在维护中).

NOTE: I don't want it to be permanent redirect, I'm just trying to "hide" the content of my site for a couple of hours with that index.html page (which says that the site is under maintenance).

推荐答案

尝试删除Options +FollowSymlinks,某些服务器不允许您覆盖php.ini设置.

Try to remove Options +FollowSymlinks , some servers won't allow you to overwrite a php.ini setting.

这篇关于htaccess全部重写为index.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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