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个错误?
发布于 2017-04-29 04:17:51
对于这个部分,ErrorDocument 404 /templates/replace404.php,您必须检查文件的绝对路径。
第二部分,在开始重写条件和规则之前,首先编写RewriteEngine On,
RewriteRule ^do/([0-9a-zA-Z]+) process.php?opt=$1 [NC, L]
^ this is the reason for 500用下面的代替
RewriteRule ^do/([0-9a-zA-Z]+) process.php?opt=$1 [NC,L]https://stackoverflow.com/questions/43691336
复制相似问题