创建一个.htaccess文件? [英] Creating an .htaccess file?

查看:108
本文介绍了创建一个.htaccess文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个.htaccess文件?它是需要创建一个.htaccess文件后重新启动服务器?

  RewriteEngine叙述上
RewriteCompatibility2在
RepeatLimit 200
的RewriteBase
#不支持的指令:[下ISAPI_Rewrite]

的RewriteCond%{HTTP:主机} ^ XXX \ .COM $
重写规则HTTP \(*)://www.xxxx.com$1 [NC,R = 301,U]
重写规则^ / main.html中$ HTTP \://www.xxx.com/index.cfm [NC,R = 301,U]

ErrorDocument的404 /Errors.htm
 

在此先感谢。

解决方案
  

如何创建.htaccess文件?

打开文本编辑器。开始打字。

您可能要争取你的编辑器,让您保存,只有具有扩展名的文件。您可能需要打你的上传软件,把它看文件(如果您是在不同的系统服务器创建文件)。

  

是它需要在创建.htaccess文件后重新启动服务器

没有。大多数的.htaccess的点是,它是在即时处理。

How to create an .htaccess file? Is it required to restart the server after creating an .htaccess file?

RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 200
RewriteBase 
# unsupported directive: [ISAPI_Rewrite]

RewriteCond %{HTTP:Host} ^xxx\.com$
RewriteRule (.*) http\://www.xxxx.com$1 [NC,R=301,U]
RewriteRule ^/main.html$ http\://www.xxx.com/index.cfm [NC,R=301,U]

ErrorDocument 404 /Errors.htm

Thanks in advance.

解决方案

how to create .htaccess file?

Open text editor. Start typing.

You might have to fight your editor to allow you to save a file that "only has an extension". You might have to fight your uploader software (if you are creating the file on a different system to the server) to get it to see the file.

is it required to restart the server after creating .htaccess file

No. Most of the point of .htaccess is that it is handled on-the-fly.

这篇关于创建一个.htaccess文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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