【发布时间】:2017-09-27 05:30:21
【问题描述】:
config.http 文件
Alias /bitnami/ "/opt/lampp/apache2/htdocs/"
Alias /bitnami "/opt/lampp/apache2/htdocs"
<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我的 .htaccess 代码
# Handle directory access
# Custom 404 File not Found Page
ErrorDocument 404 /templates/replace404.php
# Prevent file listing from the unscruplous
IndexIgnore *
# Rewrite for process.php
#RewriteRule ^do/([0-9a-zA-Z]+) process.php?opt=$1 [NC, L]
# Rewrite for article
# RewriteRule ^article/([0-9]+)/(09a-zA-Z_-)+) article.php?id=$1&title=$2 [NC, L]
好吧,第一个问题是它没有按预期抛出 replace404.php 页面,而是抛出标准 404 消息?该页面存在等,所以不知道为什么会这样。
其次是 process.php 的重写规则,如果我取消注释,那么当我尝试访问该站点时它会引发 500 错误????
【问题讨论】:
标签: .htaccess xampp http-status-code-404