Skip to content

Support permalink structure without leading index.php #91

@ssnepenthe

Description

@ssnepenthe

Feature Request

Describe your use case and the problem you are facing

Possibly related to #56? I'm not totally sure what's going on there since pretty permalinks seem to work just fine.

I am running a wp site locally with wp server. While I can set any arbitrary permalink structure using wp-cli (e.g. /%postname%/), if I want to set the permalink structure in wp-admin it must include a leading index.php:

Image

It looks like wordpress relies on the got_url_rewrite function to decide whether our server supports url rewriting/pretty permalinks, and if not adds that leading index.php.

https://github.com/WordPress/wordpress-develop/blob/0c3e42c238fc2ca907bbe649160598f39267d812/src/wp-admin/options-permalink.php#L79-L81

Describe the solution you'd like

Filter got_url_rewrite in the router script:

add_filter( 'got_url_rewrite', '__return_true' );

Any objections?

As far as I can find the only other place got_url_rewrite() is used is in the WP_Debug_Data class to check whether the server supports pretty permalinks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions