Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache Xampp'上的500内部服务器错误;虚拟主机_Apache_.htaccess_Mod Rewrite_Xampp_Virtualhost - Fatal编程技术网

Apache Xampp'上的500内部服务器错误;虚拟主机

Apache Xampp'上的500内部服务器错误;虚拟主机,apache,.htaccess,mod-rewrite,xampp,virtualhost,Apache,.htaccess,Mod Rewrite,Xampp,Virtualhost,我正在使用Xampp,并且我的计算机中有很多web项目,因此我决定创建一个虚拟主机,但当我使用htaccess重写规则创建一些友好URL时,日志中出现以下错误: AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'L

我正在使用Xampp,并且我的计算机中有很多web项目,因此我决定创建一个虚拟主机,但当我使用htaccess重写规则创建一些友好URL时,日志中出现以下错误:

AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
我试过很多贴在这里的东西,但都没用。。。你们能帮帮我吗

我的虚拟主机:

<VirtualHost myproject.com:80>
    ServerName myproject.com
    ServerAlias www.myproject.com
    DocumentRoot "D:/xampp/www/myproject"
    <Directory "D:/xampp/www/myproject">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

非常感谢:D

这些都是非常简单的规则,但是对于您的案例来说,它应该可以很好地工作,并且应该可以帮助您开始构建一些更复杂的重写规则

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(404|404\/)$ /404.html [L]

# Make sure to avoid loops. 
# Ignore rewrite rules for the files and directories that
# exist (such as index.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?p=$1 [L]

它工作得很好,非常感谢你。。。我刚刚开始搞乱htaccess,这将对我有很大帮助!
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(404|404\/)$ /404.html [L]

# Make sure to avoid loops. 
# Ignore rewrite rules for the files and directories that
# exist (such as index.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?p=$1 [L]