Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pretty permalinks #56

Open
1 task done
drzraf opened this issue Jul 10, 2019 · 6 comments
Open
1 task done

Support pretty permalinks #56

drzraf opened this issue Jul 10, 2019 · 6 comments

Comments

@drzraf
Copy link

drzraf commented Jul 10, 2019

Describe your use case and the problem you are facing

wp server does not handle wp-login.php and, more generally, any WP entry-point other than index.php

Describe the solution you'd like

Hardwiring entrypoints logic (or even parse the htaccess using PHP) in order to support them would make it.

A fully browsable WordPress instance off Apache/nginx/php-fpm would be handy in Q&A situations/simulations. The (probably < 100) lines needed may be worth it.

If login.php is requested by the client, that file would be require'd dynamically.
Some tweaks to $_SERVER may be needed though in order to mimic mod_rewrite behavior.

@alessandro-fazzi
Copy link

Hey, not the maintainer here: just a user.

I actually manage to reach http://localhost:8080/wp-login.php w/o any problem. 🤔

@lkraav
Copy link

lkraav commented Sep 12, 2019

Indeed, wp-login.php and other files work fine.

I think we're actually talking about pretty permalinks here.

Something like this might be necessary https://gist.github.com/scribu/4088244

@drzraf
Copy link
Author

drzraf commented Sep 13, 2019

I forgot to say I'm using bedrock where the layout is a bit different.

@swissspidy swissspidy changed the title in-PHP .htaccess support Support pretty permalinks Nov 11, 2023
@swissspidy
Copy link
Member

WP-CLI already has such a router script, so not sure what's missing there 🤔

@vadimkantorov
Copy link

Same problem. I've set up a test with:

sudo service mysql start
sudo mysql <<< "CREATE USER 'wpssguser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'wpssgpass';"
php ./wp-cli.phar core download --path=./wpssgblog --locale=en_US
php ./wp-cli.phar config create --path=./wpssgblog --locale=en_US --dbuser=wpssguser --dbpass=wpssgpass  --dbname=wpssgdb  --dbhost=127.0.0.1
php ./wp-cli.phar db create --path=./wpssgblog
php ./wp-cli.phar core install --path=./wpssgblog --url=wpssgblog.local --title="WP-CLI" --admin_user=wpcli --admin_password=wpcli [email protected]

Now I'm trying to get pretty permalinks:

php ./wp-cli.phar option set permalink_structure '/%year%-%monthnum%-%day%-%postname%/' --path=./wpssgblog
php ./wp-cli.phar post list --field=url --path=./wpssgblog

php ./wp-cli.phar server --host=127.0.0.1 --port=8080

# http://wpssgblog.local/wpssgblog/2024-01-28-hello-world/
# ^^^^^^^^^^^^ the above does not open, as does not open http://localhost:8080/wpssgblog/index.php/2024-01-28-hello-world/

@vadimkantorov
Copy link

If this simple server supports pretty-links, rolling a simple SSG might be as easy as pointing wget --mirror at the local instance of this web server!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants