【问题标题】:.htaccess file returns 500 Internal Server Error.htaccess 文件返回 500 内部服务器错误
【发布时间】:2021-03-21 03:03:40
【问题描述】:

我的 .htaccess 中有一些错误,但我似乎无法弄清楚是什么。 这是我的代码:

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?/$1 [L, QSA]

【问题讨论】:

  • L 和 QSA [L, QSA] 之间的标志中有一个空格字符,将其删除以查看它是否能解决您的问题。

标签: .htaccess mod-rewrite url-rewriting friendly-url


【解决方案1】:

以这种方式拥有你的 htaccess 规则文件,我在这个文件中修复了一些东西。

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule !(index\.php|resources|images|css|js|robots\.txt|favicon\.ico) index.php?%{REQUEST_URI} [L,QSA,NC]

【讨论】:

  • @user15270366,如果我的回答对您有用,请告诉我?
猜你喜欢
  • 2018-03-26
  • 2016-09-22
  • 2017-04-05
  • 1970-01-01
  • 2013-02-06
  • 2015-06-28
  • 2016-04-20
  • 1970-01-01
相关资源
最近更新 更多