<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mwiki.costasano.club/index.php?action=history&amp;feed=atom&amp;title=ICT%3AClean_URLs_for_MW_1.45</id>
	<title>ICT:Clean URLs for MW 1.45 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mwiki.costasano.club/index.php?action=history&amp;feed=atom&amp;title=ICT%3AClean_URLs_for_MW_1.45"/>
	<link rel="alternate" type="text/html" href="https://mwiki.costasano.club/index.php?title=ICT:Clean_URLs_for_MW_1.45&amp;action=history"/>
	<updated>2026-04-17T16:25:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://mwiki.costasano.club/index.php?title=ICT:Clean_URLs_for_MW_1.45&amp;diff=1622&amp;oldid=prev</id>
		<title>Mngr: Created page with &quot;== MediaWiki 1.45.2 Clean URL Configuration for kb.costasano.club ==  This document outlines the &quot;Short URL&quot; configuration for the wiki migration to version 1.45.2 on AlmaLinux 10.  === Architecture Overview === * **Domain:** &lt;code&gt;https://costasano.club&lt;/code&gt; * **Frontend (Reverse Proxy):** Nginx on AlmaLinux 10 (Handling SSL/HTTPS). * **Backend (Web Server):** Apache on AlmaLinux 10 (Handling PHP/MediaWiki). * **Document Root:** &lt;code&gt;/var/www/mw145&lt;/code&gt; (index.php...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mwiki.costasano.club/index.php?title=ICT:Clean_URLs_for_MW_1.45&amp;diff=1622&amp;oldid=prev"/>
		<updated>2026-04-11T16:30:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== MediaWiki 1.45.2 Clean URL Configuration for kb.costasano.club ==  This document outlines the &amp;quot;Short URL&amp;quot; configuration for the wiki migration to version 1.45.2 on AlmaLinux 10.  === Architecture Overview === * **Domain:** &amp;lt;code&amp;gt;https://costasano.club&amp;lt;/code&amp;gt; * **Frontend (Reverse Proxy):** Nginx on AlmaLinux 10 (Handling SSL/HTTPS). * **Backend (Web Server):** Apache on AlmaLinux 10 (Handling PHP/MediaWiki). * **Document Root:** &amp;lt;code&amp;gt;/var/www/mw145&amp;lt;/code&amp;gt; (index.php...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== MediaWiki 1.45.2 Clean URL Configuration for kb.costasano.club ==&lt;br /&gt;
&lt;br /&gt;
This document outlines the &amp;quot;Short URL&amp;quot; configuration for the wiki migration to version 1.45.2 on AlmaLinux 10.&lt;br /&gt;
&lt;br /&gt;
=== Architecture Overview ===&lt;br /&gt;
* **Domain:** &amp;lt;code&amp;gt;https://costasano.club&amp;lt;/code&amp;gt;&lt;br /&gt;
* **Frontend (Reverse Proxy):** Nginx on AlmaLinux 10 (Handling SSL/HTTPS).&lt;br /&gt;
* **Backend (Web Server):** Apache on AlmaLinux 10 (Handling PHP/MediaWiki).&lt;br /&gt;
* **Document Root:** &amp;lt;code&amp;gt;/var/www/mw145&amp;lt;/code&amp;gt; (index.php is located here).&lt;br /&gt;
* **URL Strategy:** Using the &amp;lt;code&amp;gt;/wiki/&amp;lt;/code&amp;gt; virtual prefix to simplify the Apache configuration and avoid the complex &amp;quot;exclusion lists&amp;quot; used in version 1.43.&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Nginx Proxy Configuration (The Bridge) ===&lt;br /&gt;
The Nginx proxy is configured as a &amp;quot;transparent bridge.&amp;quot; It does &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; handle rewrites; it simply passes the &amp;lt;code&amp;gt;/wiki/&amp;lt;/code&amp;gt; path through to the Apache backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nginx&amp;quot;&amp;gt;&lt;br /&gt;
server {&lt;br /&gt;
    listen 443 ssl;&lt;br /&gt;
    server_name kb.costasano.club;&lt;br /&gt;
&lt;br /&gt;
    # SSL Certs (Managed at Nginx layer)&lt;br /&gt;
    ssl_certificate /etc/letsencrypt/live/kb.costasano.club/fullchain.pem;&lt;br /&gt;
    ssl_certificate_key /etc/letsencrypt/live/kb.costasano.club/privkey.pem;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
        proxy_pass http://[BACKEND_IP_OR_HOSTNAME];&lt;br /&gt;
        proxy_set_header Host $host;&lt;br /&gt;
        proxy_set_header X-Forwarded-Proto https; # Tells MediaWiki the user is on HTTPS&lt;br /&gt;
        proxy_set_header X-Real-IP $remote_addr;&lt;br /&gt;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Apache Configuration (The Logic) ===&lt;br /&gt;
Apache handles the translation of the &amp;quot;clean&amp;quot; URL into a format PHP understands.&lt;br /&gt;
&lt;br /&gt;
==== 2.1 Enable Overrides ====&lt;br /&gt;
Ensure &amp;lt;code&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/code&amp;gt; (or your specific Vhost file) allows the &amp;lt;code&amp;gt;.htaccess&amp;lt;/code&amp;gt; file to function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Directory &amp;quot;/var/www/mw145&amp;quot;&amp;gt;&lt;br /&gt;
    AllowOverride All&lt;br /&gt;
    Require all granted&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 2.2 Create .htaccess ====&lt;br /&gt;
Place this file at &amp;lt;code&amp;gt;/var/www/mw145/.htaccess&amp;lt;/code&amp;gt;. It maps the virtual &amp;lt;code&amp;gt;/wiki/&amp;lt;/code&amp;gt; path to the physical &amp;lt;code&amp;gt;index.php&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
RewriteEngine On&lt;br /&gt;
&lt;br /&gt;
# 1. Map the virtual /wiki/ path to index.php&lt;br /&gt;
RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA]&lt;br /&gt;
&lt;br /&gt;
# 2. Redirect root domain (kb.costasano.club/) to the Main Page&lt;br /&gt;
RewriteRule ^$ /wiki/ [R,L]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3: MediaWiki LocalSettings.php ===&lt;br /&gt;
Update &amp;lt;code&amp;gt;/var/www/mw145/LocalSettings.php&amp;lt;/code&amp;gt; to define the identity of the wiki and trust the Nginx header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
## URL Settings&lt;br /&gt;
$wgServer = &amp;quot;https://costasano.club&amp;quot;;&lt;br /&gt;
$wgScriptPath = &amp;quot;&amp;quot;;         // Files are directly in /var/www/mw145&lt;br /&gt;
$wgArticlePath = &amp;quot;/wiki/$1&amp;quot;; // Users see this path&lt;br /&gt;
&lt;br /&gt;
## Reverse Proxy / HTTPS Handling&lt;br /&gt;
# Ensures MediaWiki knows it is served over HTTPS even if Apache is HTTP&lt;br /&gt;
if (isset($_SERVER[&amp;#039;HTTP_X_FORWARDED_PROTO&amp;#039;]) &amp;amp;&amp;amp; $_SERVER[&amp;#039;HTTP_X_FORWARDED_PROTO&amp;#039;] === &amp;#039;https&amp;#039;) {&lt;br /&gt;
    $_SERVER[&amp;#039;HTTPS&amp;#039;] = &amp;#039;on&amp;#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Trust the internal IP of your Nginx Proxy&lt;br /&gt;
$wgUsePrivateIPs = true;&lt;br /&gt;
$wgCdnServersNoPurge = [ &amp;#039;127.0.0.1&amp;#039;, &amp;#039;[IP_OF_NGINX_PROXY]&amp;#039; ]; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Why we use the &amp;quot;/wiki/&amp;quot; prefix ===&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Simplicity:&amp;#039;&amp;#039;&amp;#039; Unlike the version 1.43 setup, we no longer need a massive list of exclusions (RewriteCond) for every folder (skins, images, resources, etc.).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Stability:&amp;#039;&amp;#039;&amp;#039; It prevents &amp;quot;Path Collisions&amp;quot; where a wiki page name might conflict with a real folder on the disk.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Performance:&amp;#039;&amp;#039;&amp;#039; Reduces the processing load on Apache for every request.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server Documentation]]&lt;/div&gt;</summary>
		<author><name>Mngr</name></author>
	</entry>
</feed>