【发布时间】:2017-05-07 23:22:54
【问题描述】:
我尝试在 apache server 2.4 和 Debian 8 上启用重写模块 我创建了一个子域
如果我创建一个 php 文件:
<?php
if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
$res = 'Module Unavailable';
if(in_array('mod_rewrite',apache_get_modules()))
$res = 'Module Available';
echo apache_get_version();
?>
显示“模块可用”
在全局指令(/etc/apache2/apache2.conf)中我创建了:
<Directory /var/dev/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
我在根网络文件夹上创建了一个 .htaccess 文件
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^foo.html$ test.html
还有一个 test.html 文件!
在 appache 错误日志中我有这个:
[Thu Dec 22 11:36:44.828831 2016] [core:info] [pid 1884] [client 83.145.73.220:58115] AH00128:文件不存在:/home/dev/foo.html
感谢您的帮助
【问题讨论】:
标签: apache mod-rewrite