首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关于xampp 2问题的.htaccess

关于xampp 2问题的.htaccess
EN

Stack Overflow用户
提问于 2017-04-29 02:54:20
回答 1查看 36关注 0票数 1

config.http文件

代码语言:javascript
复制
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代码

代码语言:javascript
复制
# 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个错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-29 04:17:51

对于这个部分,ErrorDocument 404 /templates/replace404.php,您必须检查文件的绝对路径。

第二部分,在开始重写条件和规则之前,首先编写RewriteEngine On

代码语言:javascript
复制
RewriteRule ^do/([0-9a-zA-Z]+) process.php?opt=$1 [NC, L]
                                                      ^ this is the reason for 500

用下面的代替

代码语言:javascript
复制
RewriteRule ^do/([0-9a-zA-Z]+) process.php?opt=$1 [NC,L]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43691336

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档