我在/etc/pache2/openpanel.d/www.example.com.conf
中有一条虚拟住房指令:
<VirtualHost *:80>
ServerAdmin "[email protected]"
DocumentRoot /home/openpanel-admin/sites/www.example.com/public_html
ServerName www.example.com
ServerAlias example.com
<Directory /home/openpanel-admin/sites/www.example.com/public_html>
AllowOverride All
Allow from all
</Directory>
Include /etc/apache2/openpanel.d//www.example.com.inc/[^.#]*
Include /etc/apache2/openpanel.d//global.inc
</VirtualHost>
我在/etc/pache2/openpanel.d/www.example.com.inc/Rewrite Rowes
中列出以下内容: /etc/pache2/openpanel.d/www.example.com.inc/Rewrite Rowes
<Directory /home/openpanel-admin/sites/www.stallfinder.com/public_html>
Options +FollowSymlinks
RewriteEngine On
RewriteRule agricultural-show-c780.html /search/event/agricultural-shows/1/ [R=301,L]
RewriteRule antique-fair-c596.html /search/event/antique-and-collectors-fairs/1/ [R=301,L]
RewriteRule baby-and-toddler-fairs-c896.html /search/event/baby-and-toddler-fairs/1/ [R=301,L]
RewriteRule book-fair-c631.html /search/event/book-fairs/1/ [R=301,L]
# etc... there are ~3000 of these
</Directory>
我在/home/penpanel-admin/sites/www.example.com/public_html
中找到一个 .htaccess
文件:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# Search pages
RewriteRule ^search/(stallholder|event)/?$ /find-$1.php [L]
RewriteRule ^search/(stallholder|event)/([^/]+)/([0-9]+)/? /$1.php?name=$2&id=$3 [L]
但包含文件的重写规则(重写规则)似乎没有被解析/使用。
文件被包含在其中, 是因为我可以把不可批准的东西放在那里, 并且 Apache 无法装入配置文件, 但如果我打开 Apache 重定向记录, 那么我只看到[perdir] 线条, 好像我在 Rewrite Rules 中获得的所有 Rewrite Rules 都包括了没有被处理 。
global.inc
文件是空的, 我的 .ht access
文件中的重写规则工作正常 。
知道我做错什么了吗?