【问题标题】:mod_rewrite not reading htaccessmod_rewrite 不读取 htaccess
【发布时间】:2014-03-25 15:56:21
【问题描述】:

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

我现在的

etc/apache2/sites-available/default

<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。

【问题讨论】:

    标签: .htaccess mod-rewrite apache2


    【解决方案1】:

    所以,解决方案是将 * 更改为 IP 地址,所以在最后

    <VirtualHost *:80>
    

    看起来像这样:

    <VirtualHost 37.9.170.195:80>
    

    【讨论】:

      猜你喜欢
      • 2017-06-12
      • 2010-10-31
      • 2012-06-02
      • 2011-07-31
      • 2011-01-12
      • 2014-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多