在我的主要公共目录中,我有这个 .htaccess 文件,但是在访问时/register
出现 404 错误。
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^register$ register.php
有了这个,我想让任何访问的人都/register
可以使用/register.php
. 我确定它mod_rewrite
已启用并且AllowOverride All
存在于我的虚拟主机文件中。
有谁知道我该如何解决这个问题?我得到的只是The requested URL /register was not found on this server.
虚拟主机:
<VirtualHost *:80>
ServerAdmin my@email.com
ServerName my.site.com
DocumentRoot /home/mark/public
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/mark/public>
Options All MultiViews ExecCGI
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /home/mark/logs/public_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /home/mark/logs/public_access.log combined
</VirtualHost>