【发布时间】:2012-12-17 12:57:52
【问题描述】:
所以我在这件事上花了太多时间 - 有点绝望。
.htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^submit/?$ submit.php [NC,L]
/etc/apache2/sites-available/applicapple:
<VirtualHost *:80>
ServerAdmin support@perpetualcontrast.com
DocumentRoot /var/www/applicapple
ServerName applicapple.localhost
<Directory /var/www/applicapple/>
Options Indexes FollowSymLinks MultiViews
RewriteEngine On
AllowOverride 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
</VirtualHost>
submit.php 肯定存在。 访问 applicapple.localhost/submit 时:
目录中有submit.php,我得到The requested URL /submit was not found on this server.
如果我删除 submit.php,我会得到 The requested URL /submit.php was not found on this server.
如果我访问 localhost/applicapple,它会按预期工作。
有人能告诉我这里发生了什么吗?
【问题讨论】:
-
如果你尝试使用 sub.localhost/submit/ 而不是 sub.localhost/submit 呢?
-
效果一样,输出没有区别):
标签: linux apache mod-rewrite