0

我在 ubuntu m/c 中使用 apache2。我已启用 mod_rewrite 并更改了 apache2.conf 中的 Allowoveride All

现在我正在尝试在我的服务器中安装 Bug-Genie 应用程序但是遵循 .htaccess 规则不能正常工作。

我可以访问:

http://localhost/roxsoft/thebuggenie-3.2.6/thebuggenie/**index.php**/wiki

但我无法访问:--404 错误

http://localhost/roxsoft/thebuggenie-3.2.6/thebuggenie/wiki

这是我的 .htaccess 文件:

# .htaccess file for The Bug Genie

# make sure that magic_quotes and register_globals is always off
<IfModule mod_php5.c>
    php_flag magic_quotes_gpc   off
    php_flag register_globals   off
</IfModule>

# rewrite rules
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
# Example:
# RewriteBase /
# or
# RewriteBase /dev/thebuggenie

  # skip all hidden files (starting with a .)
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.(html|wsdl|json|xml)$
  RewriteRule .* - [L]

  # redirect to front controller
  RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]

</IfModule>
# Stop people accessing directories they shouldn't have access to
RedirectMatch 403 ^/\.svn(/|$)
4

2 回答 2

3

尝试这个:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|assets|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

将包含 JavaScript 和 CSS 的文件夹添加到重写条件

于 2013-08-16T16:13:08.943 回答
0

这是我刚刚管理它的解决方案。如果有人遇到同样的问题,这可能会有所帮助......

我刚刚删除

并在 htaccess 中添加了附加条件:

  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.(html|wsdl|json|xml)$
  RewriteCond %{REQUEST_URI} !\.(jpg|png|css|js|php|gif|ttf|woff)$   ---- ADD FILTER CONDITION.
  #RewriteRule .* - [L]                                              ---- COMMENT THIS LINE************

  # redirect to front controller
  RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]
于 2013-08-16T16:45:54.843 回答