🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.www.server-side
Article #61508

Re: Apache próbuje pobierać index.php z /var/www/html a nie z ~/public_html

#61508
From: Grzegorz Staniak
Date: Thu, 16 Jun 2016 20:51
27 lines
2226 bytes
On 2016-06-16, jivanmukta@poczta.onet.pl <jivanmukta@poczta.onet.pl> wrote:
> Używam Apache2 z userdirs pod Ubuntu. 
> Mam w /home/robert/public_html aplikację PHP (CodeIgniter).
> Adres localhost/~robert/index.php działa. Adres localhost/~robert/index.php/announcement/index również.
> Chciałbym usunąć index.php z urla. W tym celu zmodyfikowałem plik ~robert/public_html/.htaccess, tzn dopisałem:
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond $1 !^(index\.php|robots\.txt|denial\.html|resources|captcha)
> RewriteRule ^(.*)$ index.php/$1 [L,QSA]
>
> Adres localhost/~robert otwiera się.
> Problem: przy próbie otwarcia localhost/~robert/announcement/index mam 404 Not found. 
> W error.log'u Apache'a mam: script '/var/www/html/index.php' not found or unable to stat.
> Nie wiem dlaczego Apache próbuje pobierać index.php z /var/www/html a nie z ~robert/public_html.
> Byłbym wdzięczny za pomoc.

Ustawiłeś katalog główny serwera jako bazę rozwiązywania URLi.
Spróbuj:

RewriteBase /~robert/

GS
-- 
Grzegorz Staniak <gstaniak _at_ gmail *dot* com>
Technical Details
Message-ID: <slrnnm64b7.51s.wytnij-to_gstaniak@inka.staniak.eu>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.118.62.MISMATCH!peer02.fr7!news.highwinds-media.com!fx43.am4.POSTED!not-for-mail
References: <1a783e36-616b-4c0f-86c9-d757d3542a2d@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.118.62.MISMATCH!peer02.fr7!news.highwinds-media.com!fx43.am4.POSTED!not-for-mail
Newsgroups: pl.comp.www.server-side
From: Grzegorz Staniak <wytnij-to_gstaniak@gmail.com>
Subject: Re: Apache próbuje pobierać index.php z
 /var/www/html a nie z ~/public_html
References: <1a783e36-616b-4c0f-86c9-d757d3542a2d@googlegroups.com>
Organization: Disorganization Inc.
User-Agent: slrn/1.0.2 (Linux)
Mime-Version: 1.0
Message-ID: <slrnnm64b7.51s.wytnij-to_gstaniak@inka.staniak.eu>
Lines: 27
NNTP-Posting-Host: 81.106.31.41
X-Complaints-To: http://netreport.virginmedia.com
X-Trace: 1466110311 81.106.31.41 (Thu, 16 Jun 2016 20:51:51 UTC)
NNTP-Posting-Date: Thu, 16 Jun 2016 20:51:51 UTC
Date: Thu, 16 Jun 2016 20:51:51 GMT
X-Received-Bytes: 1994
X-Received-Body-CRC: 2071154139
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit