Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mod rewrite Apache重写规则,只允许一个查询字符串_Mod Rewrite_Drupal_Rewrite_Httpd.conf - Fatal编程技术网

Mod rewrite Apache重写规则,只允许一个查询字符串

Mod rewrite Apache重写规则,只允许一个查询字符串,mod-rewrite,drupal,rewrite,httpd.conf,Mod Rewrite,Drupal,Rewrite,Httpd.conf,我在服务器的根目录下有一个网站 在一个名为se的子文件夹中,我安装了drupal,因此转到 https://websiteUrl/se 启动drupal。我只希望drupal的一个页面是可访问的,并且所有其他尝试(请不要在内部更改url)都转到这个drupal接受的页面。此aboslute页面url为: /se/?q=node/555(se/index.php/?q=node/555是否应将aussi重写为/se/?q=node/555) 其他应该重写的URL如se/index.php/?q=s

我在服务器的根目录下有一个网站

在一个名为se的子文件夹中,我安装了drupal,因此转到

https://websiteUrl/se

启动drupal。我只希望drupal的一个页面是可访问的,并且所有其他尝试(请不要在内部更改url)都转到这个drupal接受的页面。此aboslute页面url为:

/se/?q=node/555(se/index.php/?q=node/555是否应将aussi重写为/se/?q=node/555) 其他应该重写的URL如se/index.php/?q=string)

我正在使用apacheconf文件和目录指令来实现这一点

这是我的httpd.conf

<Directory /var/www/se/>
AllowOverride None
RewriteEngine on
RewriteCond %{QUERY_STRING} q=node/[^555] [OR]
RewriteCond %{QUERY_STRING} ^q=([a-z]*)$
RewriteRule ^(.*)$ /se/index.php?q=node/555 [L,R]
</Directory>

不允许超限
重新启动发动机
RewriteCond%{QUERY_STRING}q=node/[^555][OR]
RewriteCond%{QUERY_STRING}^q=([a-z]*)$
重写规则^(.*)$/se/index.php?q=node/555[L,R]
这对于index.php?q=node/347这样的url是可以的,但对于index.php?q=searchString则不可以。我试图排除q=node/555的所有情况都会导致无限循环或内部javascript/css链接被重写(->坏链接)

谢谢