我在 localhost 有我的网站的副本:
/var/www/vhosts/mysite.com/httpdocs
这是我的 /etc/apache2/sites-available/mysite
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/vhosts/mysite.com/httpdocs
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
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 None
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 None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
我已将 htaccess.txt 复制到 .htaccess。当我激活友好 URL 和 URL 重写时,我收到 404 错误。
我在 .htaccess 中取消了对这一行的注释,但仍然不起作用:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
我也尝试将 rewritebase 更改为
RewriteBase /mysite
没有运气。
我做错了什么?