# New Plugin: URLCleaner

**URL:** <https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648>\
**Category:** Plugins\
**Created:** [February 28, 2023, 1:35am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648 "2023-02-28T01:35:44Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [February 28, 2023, 1:35am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/1 "2023-02-28T01:35:44Z")

</div>

Hello all, for those who have pretty urls (clean urls) configured in their Kanboard, this plugin may be useful.

I will release it to the directory once I have accumulated a few more URLs, but the plugin is fully functional and can be installed manually.

At the moment, Bigboard and Wiki are the two plugins I have added routes for.

> **[GitHub - aljawaid/URLCleaner: This simple tool extends the existing rewriting...](https://github.com/aljawaid/URLCleaner)**
>
> This simple tool extends the existing rewriting of browser URLs for your Kanboard application using this plugin. - GitHub - aljawaid/URLCleaner: This simple tool extends the existing rewriting of b...

> [@POLL: Does anyone use Pretty URLs in Kanboard?](https://kanboard.discourse.group/t/poll-does-anyone-use-pretty-urls-in-kanboard/2618):
>
> Pretty URLs are good for SEO, but in Kanboard, being an internal application, they are good for bookmarks and when sharing links between users etc. Do you find them useful? I use them alot, mainly (in Kanboard’s case) for clarity in the browser address bar. As Kanboard’s pretty urls are not for every single page, if I get enough responses, I’m considering making a plugin for it to extend pretty URLs to as many pages as possible. Choose up to 2 answers please. [poll](https://kanboard.discourse.group/t/poll-does-anyone-use-pretty-urls-in-kanboard/2618/1)

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [March 2, 2023, 12:33am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/2 "2023-03-02T00:33:45Z")

</div>

Version 1 has been released with 47 new clean URLs

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/c/c827a44fdb3e6a90486bbd14cd684e2e5328d2a0.png)

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 2, 2023, 6:53pm UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/3 "2023-10-02T18:53:03Z")

</div>

Hello all, version 2 has been released. The core routes have been merged into Kanboard from v1.2.28+ so they have been maintained in the plugin for older versions.

**If somebody could reply to this thread I can update this post next time (3 consecutive posts per user limit)**

> Kindly remember to star the repository on GitHub if you find the plugin useful or even consider a donation to maintain the plugin.

---

<div class="post-metadata">

**Author:** ![emzeweb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/emzeweb/32/1037_2.png) [@emzeweb](https://kanboard.discourse.group/u/emzeweb)\
**Post date:** [October 13, 2023, 9:18am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/4 "2023-10-13T09:18:16Z")

</div>

Hello aljawaid and thanks for this plugin I’ve been awaiting for a long time.

I don’t know how to purge old URLs though, in order for kanboard to use and display the clean ones :

once enabled, it did so directly for the board links i.e [my\_domain]/board/4

but not for the tasks - still using [my\_domain]/?controller=TaskViewController&action=show&task\_id=828&project\_id=4

instead of [my\_domain]/t/828 which, when I type it manually in the address bar, works just as well…

I cleared my browser cache but with no more success… any idea or tip ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 14, 2023, 1:46am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/5 "2023-10-14T01:46:31Z")

</div>

Hello, what KB version are you using?

I just tested on my `v1.2.22` and `v1.2.32` - both work fine with the plugin installed.

`https://mydomain.com/task/52` is what I get when I click on a board and go to the task through the board.

---

<div class="post-metadata">

**Author:** ![emzeweb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/emzeweb/32/1037_2.png) [@emzeweb](https://kanboard.discourse.group/u/emzeweb)\
**Post date:** [October 14, 2023, 10:22am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/6 "2023-10-14T10:22:01Z")

</div>

HI.  
I’m using version 1.2.32.  
Do you have mod rewrite rules in you htaccess ? if so, could you share the content of the file ? I’ve always been struggling with this one…  
My kanboard is hosted on a shared apache server, but I enabled the URL rewriting in the config file with

`define('ENABLE_URL_REWRITE', true);`

I guess it’d be cleaner to enable it on the server side… and maybe the problem comes from there ?

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 14, 2023, 6:48pm UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/7 "2023-10-14T18:48:21Z")

</div>

> Do you have mod rewrite rules in you `.htaccess` ? if so, could you share the content of the file ?

## KB v1.2.22 for `https://domain.com`

```php
# Pass HTTP Authorization header via environment variable to PHP backend
# to make HTTP Basic Authentication work for Apache/FastCGI/php-fpm
# setups (required to authenticate over the API)
<IfModule mod_setenvif.c>
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>

<IfModule mod_rewrite.c>
    Options -MultiViews

    <IfModule mod_env.c>
        SetEnv HTTP_MOD_REWRITE On
    </IfModule>
    

    # Uncomment this line depending of your Apache configuration
    # RewriteBase /

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
    
    ############################
    ## Uncomment the two lines below to enable force HTTPS capabilities
    ############################
    
    # RewriteCond %{HTTPS} !=on 
    # RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>

<IfModule pagespeed_module>
    ModPagespeed Off
</IfModule>

Header set Content-Security-Policy "default-src 'self' *.cloudflare.com *.customdomain.com 'unsafe-inline'; script-src *.customdomain.com 'self' 'unsafe-inline' https; connect-src 'self'; img-src 'self' data:; style-src 'unsafe-inline' https *; base-uri 'self'; form-action 'self'; frame-src 'self' *.customdomain.com https; child-src 'self' www..customdomain.com;"

```

## KB v1.2.32 for `https://my.domain.com`

```php
# Pass HTTP Authorization header via environment variable to PHP backend
# to make HTTP Basic Authentication work for Apache/FastCGI/php-fpm
# setups (required to authenticate over the API)
<IfModule mod_setenvif.c>
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>

<IfModule mod_rewrite.c>
    Options -MultiViews

    <IfModule mod_env.c>
        SetEnv HTTP_MOD_REWRITE On
    </IfModule>
    

    # Uncomment this line depending of your Apache configuration
    # RewriteBase /

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
    
    ############################
    ## Uncomment the two lines below to enable force HTTPS capabilities
    ############################
    
    # RewriteCond %{HTTPS} !=on 
    # RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>

<IfModule pagespeed_module>
    ModPagespeed Off
</IfModule>

Header set Content-Security-Policy "default-src 'self' *.cloudflare.com *.customdomain.com 'unsafe-inline'; script-src *.customdomain.com 'self' 'unsafe-inline' https; connect-src 'self' *.customdomain.com; img-src 'self' data: *.unsplash.com *.customdomain.com; style-src 'unsafe-inline' https *; base-uri 'self'; form-action 'self'; frame-src 'self' *.customdomain.com https; child-src 'self' www.customdomain.com;"

```

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 14, 2023, 7:05pm UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/8 "2023-10-14T19:05:43Z")

</div>

> [@emzeweb](#):
>
> My kanboard is hosted on a shared apache server, but I enabled the URL rewriting in the config file with
> 
> `define('ENABLE_URL_REWRITE', true);`

Besides the above setting, you also need `http_mod_rewrite` set to `On` on the server side. The screenshot below is from [KanboardSupport](https://kanboard.discourse.group/t/new-plugin-kanboardsupport/2434/17)

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/8/841b8504563a800c26cf78d8e952c0b58a9fdff5.png "Screenshot from KanboardSupport Plugin")

---

<div class="post-metadata">

**Author:** ![emzeweb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/emzeweb/32/1037_2.png) [@emzeweb](https://kanboard.discourse.group/u/emzeweb)\
**Post date:** [October 26, 2023, 9:40am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/9 "2023-10-26T09:40:02Z")

</div>

Hi !  
here’s the info displayed by KanboardSupport plugin on my installation.

 ![kanboard_config](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/4/4e3668a06b3d3d1fbfde2906eb31c288b047913c.jpeg)

HTTP\_MOD\_REWRITE was already enabled in my config.php file, so my settings seem to be okay ?  
and as I stated earlier, the rewritten URLs do work fine, but not in use… (apart from the board links)  
I still don’t get it…

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 27, 2023, 10:47pm UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/10 "2023-10-27T22:47:25Z")

</div>

Check that the apache module `mod_rewrite` is installed in your php:

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/5/5ad80cf3db40f23b62e12385d358db58067cedd6.png)

The screenshot is from KanboardSupport (unreleased version). I will release the version soon but you can also check through the usual `phpinfo` methods.

---

<div class="post-metadata">

**Author:** ![emzeweb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/emzeweb/32/1037_2.png) [@emzeweb](https://kanboard.discourse.group/u/emzeweb)\
**Post date:** [October 28, 2023, 8:51am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/11 "2023-10-28T08:51:34Z")

</div>

Hello,  
the URL rewrite module is installed and working in Apache, since the URL rewriting is working fine on the board URL link, as I stated in my first post, and _- since Apache modules don’t show up in php info file when PHP is running as FastCGI -_ I also tested it again by adding temporarily to my .htaccess file the following line (right after “RewriteEngine On”)

RewriteRule .\* my\_test\_file.php

And it worked indeed.

That’s why I was wondering if there’s no cache folder to be cleaned. Or URLs stored in db or whatever ?

Also, I noticed in the web.config file of my web server the following code :

```auto
<rewrite>
            <rules>
                <rule name="Kanboard URL Rewrite" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>

```

Is it plugin-related ?

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 29, 2023, 5:28am UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/12 "2023-10-29T05:28:14Z")

</div>

Thanks for the information, useful to know.

> Is it plugin-related ?

- No, I’m confident it is not. The plugin does not do anything to the `web.config` file - I think it is KB related.

---

<div class="post-metadata">

**Author:** ![emzeweb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/emzeweb/32/1037_2.png) [@emzeweb](https://kanboard.discourse.group/u/emzeweb)\
**Post date:** [November 1, 2023, 5:03pm UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/13 "2023-11-01T17:03:57Z")

</div>

Hello again,  
I finally found out that the issue was caused by the CardPushDate plugin.  
Problem solved !

---

<div class="post-metadata">

**Author:** ![sunjam](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/sunjam/32/1681_2.png) [@sunjam](https://kanboard.discourse.group/u/sunjam)\
**Post date:** [September 8, 2024, 3:41pm UTC](https://kanboard.discourse.group/t/new-plugin-urlcleaner/2648/14 "2024-09-08T15:41:45Z")

</div>

> [@aljawaid](#):
>
> Hello all, for those who have pretty urls (clean urls) configured in their Kanboard, this plugin may be useful.

I just want to say thank you, thank you, thank you, thank you. You rule. Thank you for this plugin and also thank you for KanboardSupport. etc.

Seriously, you are a beautiful person for contributing so many useful things to this great project. Thank you.
