目录块中的Apache重写规则

时间:2018-08-14 13:53:39

标签: apache mod-rewrite

我的虚拟主机conf中有以下代码:

<VirtualHost *:8080>

  DocumentRoot "/home/site1/public_html/"
  ServerName site1.com

  <Directory "/home/site1/public_html/testb">
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
  </Directory>

</VirtualHost>

访问site1.com/testb/?p=1可以访问该页面,但是访问site1.com/testb/hello-world/却给我404,我使用的是错误的重写库吗?

0 个答案:

没有答案