dongpu5600 2013-02-12 06:02
浏览 257

单击链接时显示php在此服务器上找不到请求的URL /文件名

There was one php project which was made in core php. Now my work is to change some stylesheet issues. So I just downloaded all the files with the database. After that I just made all the setup on my localhost(LAMP). Then I just browsed the page, I saw the home page is showing correctly. But when I just clicked on any of the link, I just got an error like

Not Found

The requested URL /filename.php was not found on this server.

Apache/2.2.22 (Ubuntu) Server at localhost Port 80

To check the issue when I used tail /var/log/apache2/error.log command to see the error log. I just saw

[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/

So can someone kindly tell me what is the wrong here? Any help and suggestions will be really appreciable. Thanks ...

Update

When I downloaded the file my .htaccess file was something like this

#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

here demosite is the sitename. I have replaced that

  • 写回答

1条回答 默认 最新

  • duanlujiaji10335 2013-02-12 06:08
    关注

    As you have also added .htaccess to your tags im assuming your using it,

    if it has RewriteBase / but your project is in a subdir make sure that the subdir is added to that else rewrite will look for the file in the wrong directory so add your:

    RewriteBase /path_to_the_project_folder
    
    评论

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码