.htaccess文件的正确编写方式

2 篇文章 0 订阅
今天在windows系统编写了一个.htaccess文件, 发现在apache中开放了 modules/mod_rewrite.so以及将AllowOverride None 修改成AllowOverride All. 但访问还是会出现:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

异常. 这让我感到非常不解.异常的苦恼.然后在Google, baidu,.com上搜索各种答案, 然并卵.所有的答案都指向开放mod_rewrite.so和修改 AllowOverride None.
由于我本人非常喜欢用Mac电脑, 但是我本人是做Java的,公司没有给配置Mac电脑, 但是我创建文件的习惯一直都是 Mac系统上的UTF-8格式的文件.才导致我出现的这个错误.我现在就把创建.htaccess文件的步骤以及注意一一道来.
第一步:
开放 modules/mod_rewrite.so
第二步:
将AllowOverride None 修改成 AllowOverride All
第三步:
检查创建的.htaccess文件的格式, 必须一定要与你的系统是一样的. 如果是windows,你的文件就一定要是widnows,如果是Linux就一定要是Linux的.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值