English 中文(简体)
服务器重编机不工作
原标题:Per-server rewriterules not working

我在/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 文件中的重写规则工作正常 。

知道我做错什么了吗?

最佳回答

尝试将 rewriteops 指令添加到您的. httaccess 中, 以便允许在父( 上) 级别上执行重写规则 。

http://http://httpd.apache.org/docs/text/mod/mod_restrite.html#rerewriteops"rel="nofollow" >http://http://httpd.apache.org/docs/text/mod/mod_rerestrite.html#rerewriteops

问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签