Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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 htaccess重定向赢得';如果文件不工作';不存在_Apache_.htaccess_Apache2_Debian - Fatal编程技术网

Apache htaccess重定向赢得';如果文件不工作';不存在

Apache htaccess重定向赢得';如果文件不工作';不存在,apache,.htaccess,apache2,debian,Apache,.htaccess,Apache2,Debian,服务器:带apache2的Debian var/www: project->/samba/project/ samba/项目: index.php .htaccess test.php htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase /project/ RewriteCond %{REQUEST_URI} !index.php.* RewriteRule ^(.*)$ index.php [L] localhos

服务器:带apache2的Debian

var/www: project->/samba/project/

samba/项目: index.php .htaccess test.php

htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /project/

RewriteCond %{REQUEST_URI} !index.php.*
RewriteRule ^(.*)$ index.php [L]

localhost/->它可以工作

localhost/index.php->它可以工作

localhost/test.php->it works(重定向到index.php works)

->不工作(错误403)

为什么?


thx

尝试将最后两行更改为

RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^ index.php [L]

第一行检查请求的URL是否没有映射到物理文件,第二行将每个请求(总是有开头,用^表示)重写为index.php。

尝试将最后两行更改为

RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^ index.php [L]

第一行检查请求的URL是否没有映射到物理文件,第二行将每个请求(总是有一个开头,用^表示)重写到index.php。

错误日志说:“符号链接不允许或链接目标不可访问”,但www数据有权限错误日志说:“不允许符号链接或链接目标不可访问”但www数据具有权限我们解决了所有问题,windows和debian之间的文件夹共享存在一些问题我们解决了所有问题,windows和debian之间的文件夹共享存在一些问题