Version [2785]
Dies ist eine alte Version von WikkaModRewrite erstellt von WojciechLisiewicz am 2021-03-15 19:32:54.
Activating mod_rewrite for wikka
tested on apache 2.4 and Ubuntu 14.04 LTS
- enable mod_rewrite on apache:
- in the right virtual host on apache add following directives in the right directory:
- activate rewrite on wikka config values (file wikka.config.php):
- in the root directory of wikka add an .htaccess file with following content:
sudo a2enmod rewrite
apachectl restart
apachectl restart
<Directory /path/to/your/dir>
Options FollowSymLinks
AllowOverride All
</Directory>AllowOverride All
"base_url" => "http://my.domain.com/", "rewrite_mode" => "1",
on the first line eventually add your path
(Achtung: die Zeile mit Bad Referrer ist unvollständig!)
### STOP REFERRER SPAM
SetEnvIfNoCase Referer ".*(adultsite|...).*" BadReferrer
order deny,allow
deny from env=BadReferrer
<IfModule mod_rewrite.c>
# turn on rewrite engine
RewriteEngine on
RewriteBase /pathto/subdir //(-> only if your wikka works in a subdirectory)
# if request is a directory, make sure it ends with a slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^/]+)$ $1/
# if not rewritten before, AND requested file is wikka.php
# turn request into a query for a default (unspecified) page
RewriteCond %{QUERY_STRING} !wakka=
RewriteCond %{REQUEST_FILENAME} wikka.php
RewriteRule ^(.*)$ wikka.php?wakka= [QSA,L]
# if not rewritten before, AND requested file is a page name
# turn request into a query for that page name for wikka.php
RewriteCond %{QUERY_STRING} !wakka=
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>
SetEnvIfNoCase Referer ".*(adultsite|...).*" BadReferrer
order deny,allow
deny from env=BadReferrer
<IfModule mod_rewrite.c>
# turn on rewrite engine
RewriteEngine on
RewriteBase /pathto/subdir //(-> only if your wikka works in a subdirectory)
# if request is a directory, make sure it ends with a slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^/]+)$ $1/
# if not rewritten before, AND requested file is wikka.php
# turn request into a query for a default (unspecified) page
RewriteCond %{QUERY_STRING} !wakka=
RewriteCond %{REQUEST_FILENAME} wikka.php
RewriteRule ^(.*)$ wikka.php?wakka= [QSA,L]
# if not rewritten before, AND requested file is a page name
# turn request into a query for that page name for wikka.php
RewriteCond %{QUERY_STRING} !wakka=
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>
CategoryITKnowledge
Auf dieser Seite sind keine Kommentare vorhanden