Setting up user friendly URLs
Multimedia
This is an original support article on the website of Woltlab GmbH. It has been translated and made usable here by Multimedia-Pool.com to support Spanish-speaking customers.
Addition: The Woltlab software links directly to the source code of the language file (ACP) on the support article.
WoltLab Suite offers an URL rewrite feature to turn default URLs like http://example.com/index.php?board-list/ into more compact and user friendly URLs, e.g. http://example.com/board-list/ erreichbar ist. Enabling this feature requires a special configuration applied to your webserver.
Hinweis: If you changed the paths during the installation of WoltLab Suite, you have to adapt them in the rewrite rules!
Apache / LiteSpeed
Create a file called .htaccess and add the following code to it:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Rewrite application /blog/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^blog/(.*)$ blog/index.php?$1 [L,QSA]
# Rewrite application /calendar/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^calendar/(.*)$ calendar/index.php?$1 [L,QSA]
# Rewrite application /gallery/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^gallery/(.*)$ gallery/index.php?$1 [L,QSA]
# Rewrite application /filebase/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^filebase/(.*)$ filebase/index.php?$1 [L,QSA]
# Rewrite application /forum/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^forum/(.*)$ forum/index.php?$1 [L,QSA]
# Rewrite application /wcf/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^wcf/(.*)$ wcf/index.php?$1 [L,QSA]
# Rewrite application /cms/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^cms/(.*)$ cms/index.php?$1 [L,QSA]
# Rewrite application /core/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^core/(.*)$ core/index.php?$1 [L,QSA]
# Rewrite application /
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
</IfModule>
Laden Sie diese Datei anschließend in das Hauptverzeichnis Ihrer Installation hoch.
nginx
Bearbeiten Sie die Konfiguration der Seite bzw. des VHost und fügen Sie die folgenden Zeilen ein. Bitte achten Sie darauf den Pfad /forum (in Zeile 1 und 4) entsprechend dem Installationspfad anzupassen.
location / {
index index.php;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(forum/|cms/|wcf/|calendar/|filebase/|blog/|gallery/)?([^.]+)$ /$1index.php?$2 last;
}
IIS 7.5 oder höher
Erstellen Sie die Datei web.config und fügen Sie die folgenden Zeilen ein:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WoltLab Suite Blog">
<match url="^blog/(.*)$" />
<action type="Rewrite" url="blog/index.php?{R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
<rule name="WoltLab Suite Calendar">
<match url="^calendar/(.*)$" />
<action type="Rewrite" url="calendar/index.php?{R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
<rule name="WoltLab Suite Gallery">
<match url="^gallery/(.*)$" />
<action type="Rewrite" url="gallery/index.php?{R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
<rule name="WoltLab Suite Filebase">
<match url="^filebase/(.*)$" />
<action type="Rewrite" url="filebase/index.php?{R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
<rule name="WoltLab Suite Forum">
<match url="^forum/(.*)$" />
<action type="Rewrite" url="forum/index.php?{R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
<rule name="WoltLab Suite Core">
<match url="^(cms|wcf)/(.*)$" />
<action type="Rewrite" url="{R:1}/index.php?{R:2}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
<rule name="User Friendly URLs">
<match url="^(.*)" />
<action type="Rewrite" url="index.php?{R:1}" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Laden Sie diese Datei anschließend in das Installationsverzeichnis der entsprechenden App hoch.