在我的主公共目录中,我有这个.htaccess文件,但是当访问/register
时,我得到一个404错误。简单的mod_rewrite规则不起作用
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 [email protected]
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>
而当你去'http:// yourdomain.com/register.php',你没有得到404? –
这是正确的。 – user1447941
你确定你不打算以'/'结尾的URL吗? –