【问题标题】:htaccess file hit an errorhtaccess 文件遇到错误
【发布时间】:2010-11-20 16:31:58
【问题描述】:

当我在我的项目中包含 htaccess 文件时,它会出错。

我正在使用 php 和 mysql。

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

Rewritebase /xyz/ 

# For UI Start

### For Index page 
RewriteRule ^index$ index.php [NC,L]
RewriteRule ^index/$ index.php [NC,L]

这是我的 htaccess 文件代码。

我正在使用 WAMP。

它给出一个错误内部服务器错误。

谢谢

【问题讨论】:

  • 嗨!我今年30岁。我住在科隆。外面已经天黑了,虽然还不到五点半!冬天真的来了。我目前正在做一个大型 PHP 项目,昨天浪费了半天时间寻找我自己愚蠢地插入的错误。我想我晚餐要吃鱼和意大利面。 :)
  • 张贴htaccess文件,它的存储位置,并承诺给这次回答的人加分......
  • @Sanjay 为什么需要包含 htaccess 文件?
  • @sandeepan 我正在使用它来重写网址。
  • @Sanjay URL 重写?你的意思是你试图重定向他们?您可以在没有 .htaccess 文件的情况下执行此操作。

标签: php mysql .htaccess


【解决方案1】:

最好的办法是查看错误日志文件,但我假设您无权访问它。

首先,确保在服务器上安装了mod_rewrite

试着只放

RewriteEngine On

进入 htaccess 文件。如果失败并返回 500,mod_rewrite 将被关闭,您需要与您的提供商联系。

【讨论】:

    【解决方案2】:

    您不需要包含 htaccess 文件。只要把它放在适当的地方。我相信这是你的第一次。

    【讨论】:

    • @sandeepan-its 在项目根文件夹中
    猜你喜欢
    • 2013-06-23
    • 1970-01-01
    • 2015-08-22
    • 2018-02-04
    • 1970-01-01
    • 1970-01-01
    • 2018-10-24
    • 2016-03-07
    • 1970-01-01
    相关资源
    最近更新 更多