Php 添加到.htaccess行以解决路由问题

Php 添加到.htaccess行以解决路由问题,php,.htaccess,Php,.htaccess,我们在/www/var中安装了Drupal/ 我们在/www/var/othersystem中安装了其他系统/ htacess文件非常复杂,不是我做的 我在那里写了/var/www/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^othersystem - [L] 应该有这样一条线: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQU

我们在/www/var中安装了Drupal/ 我们在/www/var/othersystem中安装了其他系统/

htacess文件非常复杂,不是我做的

我在那里写了/var/www/.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteRule ^othersystem - [L]

应该有这样一条线:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
这意味着将几乎所有内容重定向到index.php。只需再添加一个重写秒

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !^/othersystem/.*$
RewriteRule ^ index.php [L]
我相信,但不确定您是否也可以将一个新的.htaccess文件放入要忽略的文件夹中,只需:

RewriteEngine Off

尝试在您的/var/www/othersystem/.htaccess上添加此行,以重置Drupal正在使用的404处理程序:

ErrorDocument 404 default

确保这条规则是你的第一条规则。那么它怎么会不起作用呢?一开始我也想过……哦,我误解你了。这是第一个,当然,你的othersystem应用程序的完整URL是什么?admin的完整URL是/var/www/othersystem/admin。我只是检查了一下Hanks,这比我写的要好,但要么没有解决问题。我可以在删除/var/www/.htaccess文件时添加它,/var/www/othersystem/admin/works ok,我可以访问页面。我这样做了,但情况没有改变。。。当我进入othersystem/SomenoteExistentPage时,它显示othersystem 404页面,但当我进入othersystem/admin时,它显示Drupal 404 pageI添加了/var/www/othersystem/admin/.htaccess来描述在/var/www/othersystem/admin/.htaccess上面添加这一行。同样,这对测试没有帮助,您可以注释掉/var/www/.htaccess中的ErrorDocument 404行
ErrorDocument 404 default