Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> konfiguracja apache, dodawanie / na końcu pliku=>katalogu
tsharek
post
Post #1





Grupa: Zarejestrowani
Postów: 300
Pomógł: 1
Dołączył: 22.09.2003
Skąd: Czeladź

Ostrzeżenie: (0%)
-----


Witam,

Mam problem z interpretowaniem przez serwer Apacha katalogów. Postaram się najprościej wyjaśnić.

Otóż gdy wysłam żądanie do appacha:
Kod
GET /strona /HTTP1.1


otrzymuje:
Kod
HTTP/1.1 301 Moved Permanently
Date: Fri, 21 Feb 2006 10:50:00 GMT
Server: Apache
Location: http://localhost.localdomain/strona/
Content-Length: 245
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a
href="http://localhost.localdomain/strona/">here</a>.</p>
</body></html>


A chcę poprostu żeby zwrócił 404 zamiast robić redirecta.
Robię własnie stronę opartą na przyjaznych URLach i bruździ mi takie zachowania apache moją filozofię:)

Pozdrawiam i z góry dziękuję
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
dr_bonzo
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


Nie wiem jak dokladnie to rozwiazac, ale googlowanie (apache trailing slash) prowadzi do http://httpd.apache.org/docs/1.3/mod/mod_dir.html (Apache 1):

Cytat
A "trailing slash" redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/


Sugerowalbym wylaczenie modulu mod_dir, ale pozbedziesz sie tez indexow dla strony:
Cytat
[ mod_dir ] Provides for "trailing slash" redirects and serving directory index files


Choc dalej
http://httpd.apache.org/docs/2.0/mod/mod_dir.html :

Cytat
DirectorySlash Directive
Description: Toggle trailing slash redirects on or off
Syntax: DirectorySlash On|Off
Default: DirectorySlash On
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_dir
Compatibility: Available in version 2.0.51 and later
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 13.10.2025 - 18:58