htaccess
http://httpd.apache.org/docs/1.3/howto/htaccess.html
Troubleshooting
When you put configuration directives in a .htaccess file, and you don't get the desired effect, there are a number of things that may be going wrong. Most commonly, the problem is that AllowOverride is not set such that your configuration directives are being honored. Make sure that you don't have a AllowOverride None in effect for the file scope in question. A good test for this is to put garbage in your .htaccess file and reload. If a server error is not generated, then you almost certainly have AllowOverride None in effect. If, on the other hand, you are getting server errors when trying to access documents, check your Apache error log. It will likely tell you that the directive used in your .htaccess file is not permitted. Alternately, it may tell you that you had a syntax error, which you will then need to fix. The use of .htaccess files can be disabled completely by setting the AllowOverride directive to "none AllowOverride None
bbPress: mod_rewrite mit .htaccess
geschrieben von poolie | 24 Feb, 2006
bbPress Forum
Wie gestern Mittag schon angekündigt, habe ich am Abend ein wenig mit bbPress rumgspielt. Was direkt auffällt ist die Option "$bb->mod_rewrite = false;", wenn man diese aktiviert verändern sich zwar die URLs, aber die Links führen ins nichts da es noch keine offizielle .htaccess Datei gibt die den rewrite Code beherben könnte.
In der Mailings-List von bbpress.org findet man einige Beispiel diesbezüglich, hier der Code den ich nutze:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^forum/(.+)/page/?([0-9]{1,})/?$ forum.php?id=$1&page=$2 [QSA,L]
RewriteRule ^forum/(.+)/?$ forum.php?id=$1 [QSA,L]
RewriteRule ^profile/(.+)/(edit|favorites)/?$ profile.php?id=$1&tab=$2 [QSA,L]
RewriteRule ^profile/(.+)/?$ profile.php?id=$1 [QSA,L]
RewriteRule ^rss/forum/(.+)/?$ rss.php?forum=$1 [QSA,L]
RewriteRule ^rss/profile/(.+)/?$ rss.php?profile=$1 [QSA,L]
RewriteRule ^rss/tags/(.+)/?$ rss.php?tag=$1 [QSA,L]
RewriteRule ^rss/topic/(.+)/?$ rss.php?topic=$1 [QSA,L]
RewriteRule ^rss/view/(.+)/?$ rss.php?view=$1 [QSA,L]
RewriteRule ^rss/?$ rss.php [QSA,L]
RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ search.php?q=$1&page=$2 [QSA,L]
RewriteRule ^search/(.+)/?$ search.php?q=$1 [QSA,L]
RewriteRule ^tags/(.+)/page/?([0-9]{1,})/?$ tags.php?tag=$1&page=$2 [QSA,L]
RewriteRule ^tags/(.+)/?$ tags.php?tag=$1 [QSA,L]
RewriteRule ^tags/?$ tags.php [QSA,L]
RewriteRule ^topic/(.+)/page/?([0-9]{1,})/?$ topic.php?id=$1&page=$2 [QSA,L]
RewriteRule ^topic/(.+)/?$ topic.php?id=$1 [QSA,L]
RewriteRule ^view/(.+)/page/?([0-9]{1,})/?$ view.php?view=$1&page=$2 [QSA,L]
RewriteRule ^view/(.+)/?$ view.php?view=$1 [QSA,L]
Steht zur freien Verfügung.
.htaccess File im Verzeichnis dir1 enthält:
DirectoryIndex nolist.html
IndexOptions Options ...
Als Optionen sind angebbar:
Fancyindexing - ausführliche Verzeichnisliste (Icons, Name, Größe, Kurzbeschreibung etc.)
SuppressLastModified - keine Angabe der letzten Modifikationszeit
SuppressSize - keine Angabe der Filegröße
SuppressDescription - keine Angabe einer Kurzbeschreibung
ScanHTMLTitles - HTML-Titel als Kurzbeschreibung (Achtung: Rechnerlast!)
Beispiel:
.htaccess File im Verzeichnis dir2 enthält:
IndexOptions ScanHTMLTitles FancyIndexing SuppressLastModified
Ergebnis: .../dir2/
IndexIgnore file ...
Welche Files sollen nicht aufgelistet werden (auch Muster wie in der Shell mit * o.ä. möglich).
Standard: IndexIgnore */.??* *~ *.bak
Beispiel:
.htaccess File im Verzeichnis dir3 enthält:
IndexIgnore *.old
Ergebnis: .../dir3/ - die Files mit Endung .old werden nicht angezeigt.
HeaderName file
ReadmeName file
Anzeige eines Dateiinhaltes vor und/oder nach der Verzeichnisliste. Es muss sich um eine HTML- oder Textdatei handeln (also kein Bild o.ä.). Der Inhalt von <TITLE> kann nicht beeinflußt werden.
Standard:
HeaderName HEADER
ReadmeName README
Beispiel:
.htaccess File im Verzeichnis dir4 enthält:
HeaderName top.html
ReadmeName end.txt
Ergebnis: .../dir4/
AddDescription "Text" file
AddIcon (ALT,/path/to/icon) file
Angabe einer Kurzbeschreibung bzw. eines Icons für ein File (oder mehrere bei Filnamens-Muster). ALT ist eine Zeichenkette für ASCII-Browser <IMG ALT=...>. Weiterhin sind AddIconByEncoding, AddIconByType, DefaultIcon möglich.
Standard:
keine Beschreibung, Standard-Icon-Satz
Beispiel:
.htaccess File im Verzeichnis dir5 enthält:
IndexOptions FancyIndexing
AddDescription "Nur als Demonstration" *.gif
AddIcon (IMG,/Images/anim/new.gif) 1.gif
DefaultIcon /icons/blank.gif
Ergebnis: .../dir5/
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
http://www.rootforum.de/forum//viewtopic.php?t=39032
Die .htpasswd erstellt/erweitert man üblicherweise per:
Code:
htpasswd [-c] passwordfile username password
| /DebianPakete /Logfile /Module /SSL /Sicherheit /VirtualHost /VirtuelleHosts /build /htaccess /tracback /tuning |
Kategorie/Internet Kategorie/Linux
Tags: linux | gnu | unix | howto | apache | webdserver | php | mysql | python | www | web
Linux/Apache/htaccess (last edited 2009-07-07 12:26:21 by DetlevLengsfeld)