mod_rewrite没有读取htaccess

时间:2014-03-17 08:15:34

标签: .htaccess mod-rewrite apache2

我试图在服务器上启用mod_rewrite。我的网站位于/data/web/new-domovreality.sk/web文件夹中。此文件夹中有.htacces和index.php文件。

我当前的

  

等/ apache2的/位点可用/默认

<VirtualHost *:80>

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
<Directory /data/web/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride All
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

我已经阅读了我认为启用它的每条指令,但我无法做到。有人能帮我吗?我是第一次这样做。感谢

当我使用phpinfo()时,启用了mod_rewrite。

1 个答案:

答案 0 :(得分:0)

因此,解决方案是将*更改为IP地址,因此最终

<VirtualHost *:80>

看起来像这样:

<VirtualHost 37.9.170.195:80>