有一个 php 项目是用核心 php 制作的。现在我的工作是更改一些样式表问题。所以我只是用数据库下载了所有文件。之后,我只是在我的本地主机(LAMP)上进行了所有设置。然后我刚刚浏览了页面,我看到主页显示正确。但是当我点击任何一个链接时,我只是得到了一个错误,比如
Not Found
The requested URL /filename.php was not found on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
当我使用tail /var/log/apache2/error.log
命令查看错误日志时检查问题。我刚看到
[error] [client 127.0.0.1] script '/var/www/filename.php' not found or unable to stat, referer: http://localhost/path to the project folder/
那么有人可以告诉我这里有什么问题吗?任何帮助和建议都将是非常可观的。谢谢 ...
更新
当我下载文件时,我的.htaccess
文件是这样的
#suPHP_ConfigPath /home/demosite/public_html
<IfModule mod_php4.c>
php_value session.use_trans_sid 0
php_value session.cookie_time 3600
php_value session.gc_maxlifetime 3600
#php_value session.cookie_domain ".demosite.com"
</IfModule>
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_+-]+)\.html $1.php
#RewriteRule 404\.shtml$ 404.php
Options +SymLinksIfOwnerMatch
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([A-Za-z0-9]+)\.demosite\.com<>/([^/]*)
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
RewriteRule ^(.*)$ - [E=USER:%1]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^demosite\.com
RewriteCond %{ENV:USER} ^(.+)$
RewriteRule ^(.*) company_index.php?uid=%1
RewriteCond %{HTTP_HOST} ^www\.([A-Za-z0-9]+)\.demosite\.com
RewriteRule ^(.*) company_index.php?uid=%1
RewriteRule categories\/([a-zA-Z0-9_+-]+)\.html browsecats.php?browse=$1
RewriteRule categories\/([a-zA-Z0-9_+-]+)\/([0-9]+)\/([a-zA-Z0-9_+-]+)\.html browsecats.php?browse=$1&cid=$2
RewriteRule listings\/([a-zA-Z0-9_+-]+)\.html listings.php?browse=$1
RewriteRule listings\/([a-zA-Z0-9_+-]+)\/([0-9]+)\.html listings.php?browse=$1&pg=$2
RewriteRule listings\/([a-zA-Z0-9_+-]+)\/([0-9]+)\/([a-zA-Z0-9_+-]+)\.html listings.php?browse=$1&cid=$2
RewriteRule listings\/([a-zA-Z0-9_+-]+)\/([0-9]+)\/([a-zA-Z0-9_+-]+)\/([0-9]+)\.html listings.php?browse=$1&cid=$2&pg=$4
RewriteRule ^([a-zA-Z0-9_+-]+)\.htm$ $1.html
这里 demosite 是站点名称。我已经替换了