【问题标题】:apache rewrite on virtualhost won't work虚拟主机上的 apache 重写将不起作用
【发布时间】:2012-12-13 17:26:37
【问题描述】:

在配置我的 apache 虚拟主机以与 mod_rewrite 一起工作时遇到问题。我一直在启用 mod_rewrite a2enmod rewrite,我正在为我的虚拟主机创建 conf 文件

ServerName wpa.myserver.com
ServerAdmin webmaster@localhost

    DocumentRoot "/var/www/wordpress"
    <Directory "/var/www/wordpress">
       AllowOverride All
       Options +FollowSymLinks
       Order allow,deny
       allow from all
    </Directory>

在 apache 重新加载时我收到错误 500,在我的日志文件中我收到以下内容

Invalid command 'Rewrite', perhaps misspelled or defined by a module not included...

htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Rewrite test.html index.html
</IfModule>

# END WordPress

PS。以前我试图使用 webmin 来配置我的虚拟主机

【问题讨论】:

  • 您显示的代码中没有“重写”,它必须在其他地方?

标签: apache rewrite virtualhost


【解决方案1】:
Rewrite test.html index.html

Rewrite 不是有效语句。

你的意思可能是RewriteRule

【讨论】:

    猜你喜欢
    • 2018-05-09
    • 2015-02-22
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 2015-10-23
    • 1970-01-01
    • 2021-05-03
    • 2018-12-21
    相关资源
    最近更新 更多