URL Rewrites#
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/
.
Enabling this feature requires a special configuration applied to your webserver.
Note
This article is intended for customers who run the software independently on their own server or web hosting. If you are hosting the software in the WoltLab Cloud, the technical support takes care of setting up the URL rewrites.
Apache / LiteSpeed#
In the admin panel under Configuration → Options → General → Page → Search Engine Optimization click on the Generate Rewrite Rules button and create a file named .htaccess
with the displayed content.
Then upload this file to the root directory of your installation.
Enable URL rewrites via the Enable url-rewrite option in the admin panel under Configuration → Options → General → Page → Search Engine Optimization.
nginx#
Edit the configuration of the page or VHost and insert the following lines. Please make sure to adjust the path /forum (in line 1 and 4) according to the installation path.
Note
If you have changed the paths during the installation of WoltLab Suite, you have to change them in the rewrites.
location / {
index index.php;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(forum/|cms/|wcf/|calendar/|filebase/|blog/|gallery/)?([^.]+)$ /$1index.php?$2 last;
}
Enable URL rewrites via the Enable url-rewrite option in the admin panel under Configuration → Options → General → Page → Search Engine Optimization.
IIS 7.5+#
Create a file named web.config
and insert the following lines:
Note
If you have changed the paths during the installation of WoltLab Suite, you have to change them in the rewrites.
<?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>
Then upload this file to the installation directory of the corresponding app.
Enable URL rewrites via the Enable url-rewrite option in the admin panel under Configuration → Options → General → Page → Search Engine Optimization.