Skip to content

Conversation

@torounit
Copy link
Member

What is this PR doing?

Remove index.php from permalink structure.

What problem is it solving?

The WordPress playground supports rewrite. URLs like nginx and apache can achieve this.

How is the problem addressed?

add add_filter( 'got_url_rewrite', '__return_true' ); to mu-plugins.

Testing Instructions


// Activate URL rewriting.
await this.php.writeFile(
`${this.wordpressPath}/wp-content/mu-plugins/got-url-rewrite.php`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename the file to 4-enable-url-rewrite.php so that the name communicates the purpose

@adamziel
Copy link
Collaborator

adamziel commented Oct 20, 2023

This is great @torounit, thank you so much for contributing this! It works pretty well in my testing:

CleanShot 2023-10-20 at 10 18 19@2x CleanShot 2023-10-20 at 10 18 03@2x

I only left one nitpicky comment.

@torounit
Copy link
Member Author

@adamziel Thank you for reviewing!

This problem also occurs in vscode extension and wp-now. Should they be fixed in WordPress/playground-tools ?

@torounit torounit requested a review from adamziel October 23, 2023 14:58
@adamziel
Copy link
Collaborator

@torounit thank you!

This problem also occurs in vscode extension and wp-now. Should they be fixed in WordPress/playground-tools?

In a short term, yes.

In a medium term, I'd like these patches to be applied much more granularly as right now they're mushed together inside a single prepareForRunningInsideWebBrowser method. Once that happens, the vscode extension and wp-now will be able to just grab the "enable permalinks" patch.

@adamziel adamziel merged commit 89ccddc into WordPress:trunk Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants