Remove app.php from custom routes

Discussion forum for Extension Writers regarding Extension Development.
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 520
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Remove app.php from custom routes

Post by danieltj »

Is there a way to remove the app.php file name from custom routes defined through extensions using the phpBB router?

I have the following code in my routing.yml file:

Code: Select all

danieltj_api_default_route:
    path: /api/v1
    defaults: { _controller: danieltj.api.controller:default }

However I can only get to that page by going to:

Code: Select all

DOMAIN/app.php/api/v1
I ask because I noticed that when you report a post, you get taken to the following URL:

Code: Select all

DOMAIN/post/POSTID/report
Although, when visiting the FAQ page, you get taken to this URL:

Code: Select all

DOMAIN/app.php/help/faq
Any ideas, please? 🙂
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3886
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: Remove app.php from custom routes

Post by Kailey »

Not sure about programmatically, but for each board under "Server Settings", set this option to yes.

server_settings.png
You do not have the required permissions to view the files attached to this post.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 520
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: Remove app.php from custom routes

Post by danieltj »

Huh... yeah that did it. Thanks! 😄
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.

Return to “Extension Writers Discussion”