将.htaccess移动到apache 000-default.conf

时间:2015-01-27 08:12:32

标签: linux apache ubuntu

我正在尝试将.htaccess的内容移动到apache。

这是我的.httaccess工作正常。

     RewriteEngine On
     RewriteBase /
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^contact-me/?$ index.php?page=contact [NC,L]
     RewriteRule ^about-me/?$ index.php?page=about [NC,L]

我将.htaccess代码移动到000-default.connf,如下所示:

     <VirtualHost *:80>
     ServerName www.mysite.com

     <Directory /var/www/>

     RewriteEngine On
     RewriteBase /
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^contact-me/?$ index.php?page=contact [NC,L]
     RewriteRule ^about-me/?$ index.php?page=about [NC,L]

     </Directory>
     </VirtualHost>

哪个不起作用,但是如果我把&#34; Deny从所有&#34;或其他规则,它工作正常。

有什么想法吗?

0 个答案:

没有答案
相关问题