server-command
server-command copied to clipboard
Support pretty permalinks
- [x] Yes, I reviewed the contribution guidelines.
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.
Hey, not the maintainer here: just a user.
I actually manage to reach http://localhost:8080/wp-login.php w/o any problem. 🤔
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
I forgot to say I'm using bedrock where the layout is a bit different.
WP-CLI already has such a router script, so not sure what's missing there 🤔
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/
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!